public class PEButton extends ProcessHelper implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Modifier and Type | Field and Description |
---|---|
protected boolean |
f_centerImage |
protected ProcessEditor |
f_editor |
protected java.awt.Image |
f_image |
protected java.awt.Stroke |
f_lineStroke |
protected java.awt.Point |
f_position |
protected java.awt.Dimension |
f_size |
protected java.lang.String |
f_text |
protected ProcessUtils.Orientation |
f_textOrientation |
TAG_HELPER
contexts, FALSE, PROP_CLASS_TYPE, PROP_ID, TRUE
Constructor and Description |
---|
PEButton(ProcessEditor editor) |
PEButton(ProcessEditor editor,
java.awt.Image image) |
PEButton(ProcessEditor editor,
java.lang.String text) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(PEButtonListener listener) |
java.lang.Object |
clone() |
boolean |
contains(java.awt.Point p)
returns true if the given point is within the bounds
of this PEButton
|
void |
destroy() |
protected void |
finalize() |
java.awt.Rectangle |
getBounds() |
java.awt.Point |
getPosition()
returns the position in coordinate-system of the corresponding ProcessEditor
|
ProcessUtils.Orientation |
getTextOrientation()
returns the Orientation value which is used for the alignment of the text
|
boolean |
isHighlighted()
returns true if the button is highlighted (Mouse is over the button)
|
boolean |
isSelectable()
Returns whether this ProcessHelper can be selected in the ProcessEditor or not.
|
boolean |
isVisible()
Returns a boolean which defines whether this button is visible (will be drawn onto the
ProcessEditor) or not
|
void |
mouseClicked(java.awt.event.MouseEvent arg0) |
void |
mouseDragged(java.awt.event.MouseEvent arg0) |
void |
mouseEntered(java.awt.event.MouseEvent arg0) |
void |
mouseExited(java.awt.event.MouseEvent arg0) |
void |
mouseMoved(java.awt.event.MouseEvent evt) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent arg0) |
void |
paint(java.awt.Graphics gra)
draws the button on the ProcessEditors Canvas
|
void |
setCenterImage(boolean value)
If set to true (the default value) the image of the button will be drawn
in the center.
|
void |
setHighlighted(boolean value)
tells this button whether it should be drawn highlighted or not.
|
void |
setImage(java.awt.Image image)
sets a new image to be drawn on the button
|
void |
setPosition(java.awt.Point pos)
Sets a new position for the button, relative to the corresponding
ProcessEditor
|
void |
setSize(java.awt.Dimension size)
Sets the new size for the button
|
void |
setSize(int width,
int height)
Sets the new size for the button
|
void |
setText(java.lang.String text)
Sets the text which will be displayed on the button
|
void |
setTextOrientation(ProcessUtils.Orientation orientation)
specifies the alignemnt of the text
|
void |
setVisible(boolean value)
Sets a boolean which defines whether this button is visible (will be drawn onto the
ProcessEditor) or not
|
getXmlTag
addContext, addListener, equals, getAlpha, getContexts, getId, getName, getPropertyEditor, isSelected, removeContext, removeListener, setAlpha, setId, setProperty, setPropertyEditor, setSelected
getProperty, getPropertyKeys, getSerialization, removeProperty
protected ProcessEditor f_editor
protected java.lang.String f_text
protected ProcessUtils.Orientation f_textOrientation
protected java.awt.Image f_image
protected java.awt.Point f_position
protected java.awt.Dimension f_size
protected boolean f_centerImage
protected final java.awt.Stroke f_lineStroke
public PEButton(ProcessEditor editor)
public PEButton(ProcessEditor editor, java.awt.Image image)
public PEButton(ProcessEditor editor, java.lang.String text)
public java.lang.Object clone()
clone
in class ProcessHelper
public void addListener(PEButtonListener listener)
public boolean contains(java.awt.Point p)
contains
in class ProcessHelper
p
- protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void destroy()
public java.awt.Rectangle getBounds()
public java.awt.Point getPosition()
public ProcessUtils.Orientation getTextOrientation()
public boolean isHighlighted()
isHighlighted
in class ProcessObject
public boolean isSelectable()
ProcessHelper
isSelectable
in class ProcessHelper
public boolean isVisible()
public void paint(java.awt.Graphics gra)
paint
in class ProcessHelper
g
- public void setCenterImage(boolean value)
b
- public void setHighlighted(boolean value)
setHighlighted
in class ProcessObject
value
- public void setImage(java.awt.Image image)
image
- public void setTextOrientation(ProcessUtils.Orientation orientation)
orientation
- public void setPosition(java.awt.Point pos)
pos
- public void setSize(java.awt.Dimension size)
width
- height
- public void setSize(int width, int height)
width
- height
- public void setText(java.lang.String text)
text
- public void setVisible(boolean value)
public void mouseClicked(java.awt.event.MouseEvent arg0)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent arg0)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent arg0)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent arg0)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent arg0)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface java.awt.event.MouseMotionListener