|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
verinec.gui.core.NwComponent
verinec.gui.core.NwNode
public abstract class NwNode
Handles common events of the hubs and the nodes. Adds the coordinates to the definition XML if they do not yet exist.
| Nested Class Summary | |
|---|---|
(package private) class |
NwNode.MoveKeyListener
Listener for keyboard typing. |
| Nested classes/interfaces inherited from class verinec.gui.core.NwComponent |
|---|
NwComponent.Mouse |
| Nested classes/interfaces inherited from class javax.swing.JLabel |
|---|
JLabel.AccessibleJLabel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected boolean |
dragged
Whether the node is currently being moved with the mouse. |
private static Random |
generator
|
| Fields inherited from class verinec.gui.core.NwComponent |
|---|
componentIcon, componentIconNeg, config, drawPanel, gui, pos, selection, type |
| Fields inherited from class javax.swing.JLabel |
|---|
labelFor |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
protected |
NwNode(Element config,
float factor,
String iconPath,
VerinecStudio gui,
int type)
Passes the parameters to the super class. |
| Method Summary | |
|---|---|
protected void |
addNodeinfoElement(int posX,
int posY)
Adds the layout tag to the defintionelement of the component. |
protected static Element |
createNodeInfo(Element config,
int x,
int y)
Create the node layout information and add it to the config. |
protected Element |
getLayoutChild(Element config)
Extract the node gui information child from the configuration, add a default if necessary. |
void |
initialize()
Lets the super class perform the initialization, then re-adds the mouse listeners. |
void |
resizeComponent(float factor)
Resizes the node, adjusting it to its new size and also moves it to the right location if we zoom in or out. |
void |
setBounds(int x,
int y,
int w,
int h)
Set the position and size of the node. |
| Methods inherited from class verinec.gui.core.NwComponent |
|---|
addContextMenu, addContextMenuSeparator, changeIcon, delete, getAbsX, getAbsY, getConfig, getDefaultSize, getRandomId, getType, isSelected, moveComponent, resizeDefaultSize, setBounds, setLocation, setLocation, setSelected, showIcon |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static Random generator
protected boolean dragged
| Constructor Detail |
|---|
protected NwNode(Element config,
float factor,
String iconPath,
VerinecStudio gui,
int type)
config - The XML config element of the component. If you have none, use createElement to produce one.factor - A ratio to the default size.iconPath - The location where the icon can be found.gui - The main application.type - The network type of this node.| Method Detail |
|---|
public void initialize()
initialize in class NwComponentprotected Element getLayoutChild(Element config)
getLayoutChild in class NwComponentconfig - The network xml object.
public void setBounds(int x,
int y,
int w,
int h)
setBounds in class NwComponentx - Top left corner x coordinatey - Top left corner y coordinatew - With of componenth - Height of componentpublic void resizeComponent(float factor)
NwComponent.resizeComponent(float) to also move the node.
resizeComponent in class NwComponentfactor - the resize factor for the icon.
protected void addNodeinfoElement(int posX,
int posY)
This tag contains the coordinates of the component. Take care to normalise them to zoom factor 1 before calling this method.
posX - the x position that shall be added.posY - the y position that shall be added.
protected static Element createNodeInfo(Element config,
int x,
int y)
config - The node configuration the node info will be attached to.x - coordinate.y - coordinate.
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||