|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
org.jgraph.pad.actions.AbstractActionDefault
org.jgraph.pad.AbstractDefaultVertexnPortsCreator
This the upper class of various java beans containing their own data for the default cell creation of a given type once a button is pressed. This class contains generic methods to insert the cell and its ports in the graph model.
Field Summary |
Fields inherited from class org.jgraph.pad.actions.AbstractActionDefault |
graphpad |
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface org.jgraph.pad.resources.TranslatorConstants |
PREFIX_COMPONENT, PREFIX_MESSAGE_ERROR, PREFIX_MESSAGE_INFORMATION, PREFIX_MESSAGE_WARING, SUFFIX_ACCELERATOR, SUFFIX_ACTION, SUFFIX_ICON, SUFFIX_IMAGE, SUFFIX_LABEL, SUFFIX_MENU, SUFFIX_MNEMONIC, SUFFIX_TEXT, SUFFIX_TITLE, SUFFIX_TOOL_TIP_TEXT |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
AbstractDefaultVertexnPortsCreator()
|
|
AbstractDefaultVertexnPortsCreator(GPGraphpad graphpad)
|
Method Summary | |
void |
actionForCell(DefaultGraphCell cell)
This hook allow to take a special action just after creating the cell For instance editing the cell. |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addVertexnPorts(java.awt.geom.Rectangle2D bounds,
GPGraphpad graphpad)
This is a convenient hook to automatically add a cell, its ports and a custom user object. |
AttributeMap |
getAttributeMap(DefaultGraphCell cell,
java.awt.geom.Rectangle2D bounds)
You can override how the view attributes of the cell are created |
java.lang.String |
getCellLabel()
Override if necessary |
static java.lang.String |
getDEFAULT_PORT_NAME()
|
java.lang.String |
getModelType()
usefull to use as a key for a cell model factory |
java.lang.String |
getPortName(int i)
Unless the cell is created with differenciated port names, ports are all called undifferenciated_port followed by the i indice. |
java.lang.String[] |
getPortNames()
|
java.awt.Component |
getToolComponent(java.lang.String actionCommand)
Returns a clean JButton which has a link to this action. |
java.util.Map |
getUserObjectProperties(DefaultGraphCell cell)
We assume the user would like to freely override how the cell custom user object properties are created |
double[] |
getXPortsList()
By default a cell don't have ports |
double[] |
getYPortsList()
By default a cell don't have ports |
boolean |
hasFlottingPort()
By default there aren't any floatting port. |
protected java.awt.geom.Rectangle2D |
reSize(java.awt.geom.Rectangle2D bounds)
By default we resize the cell in a square but this may be be subclassed in order to cancel such automatic resizing... |
static void |
setDEFAULT_PORT_NAME(java.lang.String default_port_name)
|
void |
setGraphpad(GPGraphpad graphpad)
Sets the graphpad. |
void |
update()
empty implementation for this typ of action |
Methods inherited from class org.jgraph.pad.actions.AbstractActionDefault |
getCurrentDocument, getCurrentGraph, getCurrentGraphLayoutCache, getGraphpad, getMenuComponent, getMenuComponents, getName, getPresentationText, getToolComponents, setFontNameForSelection, setFontSizeForSelection, setFontStyleForSelection, setSelectionAttributes |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jgraph.pad.VertexnPortsCreatorInterface |
getButton, getCellType |
Constructor Detail |
public AbstractDefaultVertexnPortsCreator(GPGraphpad graphpad)
public AbstractDefaultVertexnPortsCreator()
Method Detail |
public double[] getXPortsList()
getXPortsList
in interface VertexnPortsCreatorInterface
public double[] getYPortsList()
getYPortsList
in interface VertexnPortsCreatorInterface
public java.lang.String getPortName(int i)
i
- int
public java.lang.String[] getPortNames()
getPortNames
in interface VertexnPortsCreatorInterface
public boolean hasFlottingPort()
hasFlottingPort
in interface VertexnPortsCreatorInterface
public void setGraphpad(GPGraphpad graphpad)
AbstractActionDefault
setGraphpad
in interface VertexnPortsCreatorInterface
setGraphpad
in class AbstractActionDefault
graphpad
- The graphpad to setpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void update()
AbstractActionDefault
update
in class AbstractActionDefault
public java.awt.Component getToolComponent(java.lang.String actionCommand)
AbstractActionDefault
getToolComponent
in class AbstractActionDefault
public void addVertexnPorts(java.awt.geom.Rectangle2D bounds, GPGraphpad graphpad)
addVertexnPorts
in interface VertexnPortsCreatorInterface
bounds
- graphpad
- protected java.awt.geom.Rectangle2D reSize(java.awt.geom.Rectangle2D bounds)
bounds
-
public java.util.Map getUserObjectProperties(DefaultGraphCell cell)
cell
-
public java.lang.String getCellLabel()
public AttributeMap getAttributeMap(DefaultGraphCell cell, java.awt.geom.Rectangle2D bounds)
cell
- bounds
-
public java.lang.String getModelType()
getModelType
in interface VertexnPortsCreatorInterface
public void actionForCell(DefaultGraphCell cell)
cell
- public static java.lang.String getDEFAULT_PORT_NAME()
public static void setDEFAULT_PORT_NAME(java.lang.String default_port_name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |