|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--edu.rice.comp440.net.NeuralNetworkVisualizer.NeuralNetworkPanel
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
java.awt.Color |
BACKGROUND_COLOR
|
int |
BORDER
|
java.awt.Color |
CONNECTION_CENTER_COLOR
|
java.awt.Color |
CONNECTION_MAX_COLOR
|
java.awt.Color |
CONNECTION_MIN_COLOR
|
java.awt.Color |
CONNECTION_SELECTED_CENTER_COLOR
|
java.awt.Color |
CONNECTION_SELECTED_CENTER_COLOR_2
|
java.awt.Color |
CONNECTION_SELECTED_MAX_COLOR
|
java.awt.Color |
CONNECTION_SELECTED_MIN_COLOR
|
int |
HEIGHT
|
int |
INPUT_LENGTH
|
protected int |
LEVEL_SPACING
|
protected NeuralNetwork |
net
|
int |
NODE_DIAMETER
|
java.awt.Color |
NODE_FILL_COLOR
|
java.awt.Color |
NODE_OUTLINE_COLOR
|
java.awt.Color |
NODE_SELECTED_COLOR
|
protected int[] |
selected
|
java.awt.Color |
TEXT_COLOR
|
java.awt.Font |
TEXT_FONT
|
int |
WIDTH
|
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 |
Constructor Summary | |
protected |
NeuralNetworkVisualizer.NeuralNetworkPanel(NeuralNetwork net)
Builds a neural network panel |
Method Summary | |
protected int[] |
getNode(int x,
int y)
Returns the node at the given lcoation, or null if none exists |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this panel |
protected int |
getX(int level,
int num)
Returns the x-coordinate of the given node |
protected int |
getY(int level,
int num)
Returns the y-coordinate of the given node |
protected boolean |
isSelected(int level,
int num)
Returns whetehr or not the node is slected |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics g)
Draws this panel. |
protected void |
paintConnection(java.awt.Graphics2D g2,
int x1,
int y1,
int x2,
int y2,
double weight,
boolean selected)
Draws one connection |
protected void |
paintConnections(java.awt.Graphics2D g2)
Paints the connections between the nodes |
protected void |
paintNode(java.awt.Graphics2D g2,
int x,
int y,
java.lang.String label)
Paints a node at the given location |
protected void |
paintNode(java.awt.Graphics2D g2,
int x,
int y,
java.lang.String label,
boolean selected)
Paints a node at the given location |
protected void |
paintNodes(java.awt.Graphics2D g2)
Paints the nodes |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
print,
printAll,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public final int WIDTH
public final int HEIGHT
public final int BORDER
public final int NODE_DIAMETER
public final int INPUT_LENGTH
public final java.awt.Font TEXT_FONT
public final java.awt.Color TEXT_COLOR
public final java.awt.Color BACKGROUND_COLOR
public final java.awt.Color NODE_OUTLINE_COLOR
public final java.awt.Color NODE_FILL_COLOR
public final java.awt.Color NODE_SELECTED_COLOR
public final java.awt.Color CONNECTION_MAX_COLOR
public final java.awt.Color CONNECTION_CENTER_COLOR
public final java.awt.Color CONNECTION_MIN_COLOR
public final java.awt.Color CONNECTION_SELECTED_MAX_COLOR
public final java.awt.Color CONNECTION_SELECTED_CENTER_COLOR
public final java.awt.Color CONNECTION_SELECTED_CENTER_COLOR_2
public final java.awt.Color CONNECTION_SELECTED_MIN_COLOR
protected int LEVEL_SPACING
protected int[] selected
protected NeuralNetwork net
Constructor Detail |
protected NeuralNetworkVisualizer.NeuralNetworkPanel(NeuralNetwork net)
net
- The net to base this panel onMethod Detail |
public java.awt.Dimension getPreferredSize()
public void paint(java.awt.Graphics g)
g
- Where to draw the panelprotected void paintConnections(java.awt.Graphics2D g2)
g2
- The grpahicsprotected void paintConnection(java.awt.Graphics2D g2, int x1, int y1, int x2, int y2, double weight, boolean selected)
g2
- The grpahicsx1
- start xy1
- start yx2
- end xy2
- end yweight
- The weightprotected void paintNodes(java.awt.Graphics2D g2)
g2
- The grpahicsprotected boolean isSelected(int level, int num)
protected void paintNode(java.awt.Graphics2D g2, int x, int y, java.lang.String label)
g2
- The graphicsx
- The x coordinatey
- The y coordinatelabel
- The labelprotected void paintNode(java.awt.Graphics2D g2, int x, int y, java.lang.String label, boolean selected)
g2
- The graphicsx
- The x coordinatey
- The y coordinatelabel
- The labelhightlighed
- Whetehr or not this node is selectedprotected int getX(int level, int num)
level
- The levelnum
- The numprotected int getY(int level, int num)
level
- The levelnum
- The numprotected int[] getNode(int x, int y)
x
- The x locationy
- The y locationpublic void mouseEntered(java.awt.event.MouseEvent e)
public void mouseExited(java.awt.event.MouseEvent e)
public void mousePressed(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
public void mouseClicked(java.awt.event.MouseEvent e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |