|
|||||||||
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.JPanel
visualize.LineDrawPanel
public class LineDrawPanel
The Class LineDrawPanel
extends JPanel
and is a Panel, in which the user can define the opacity from the transfer-function.
The opacity is interpolated between special points defined by the user. Those Points are of type TransferPoint
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
LineDrawPanel()
Generates a new LineColorPanel and sets the initial TransferPoints. |
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
Adds an ActionListener to the Panel. |
void |
deleteSelectedPoint()
Deletes the selected TransferPoint. |
void |
fTOpened()
Is called when the user opens an existing transfer-function and redraws the LineDrawPanel, so that it shows the content of the opened transfer-function. |
static float[] |
getInterpolatedOpacity()
Returns the interpolated opacity between the first and the last TransferPoint in form of a FloatBuffer. |
java.util.LinkedList<TransferPoint> |
getPoints()
Returns the TransferPoints from the LineDrawPanel. |
int |
getSelectedGrayValue()
Returns the gray-value of the selected TransferPoint. |
int |
getSelectedOpacityValue()
Returns the opacity-value of the selected color-point. |
void |
init()
Resets the LineDrawPanel to it's initial state. |
void |
keyPressed(java.awt.event.KeyEvent e)
Empty function. |
void |
keyReleased(java.awt.event.KeyEvent e)
Empty function. |
void |
keyTyped(java.awt.event.KeyEvent e)
Empty function. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Empty function. |
void |
mouseDragged(java.awt.event.MouseEvent e)
If the user clicks on a TransferPoint and draggs the mouse the color-point will be dragged. |
void |
mouseDragMoved(java.awt.event.MouseEvent e)
Empty function. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Empty function. |
void |
mouseExited(java.awt.event.MouseEvent e)
Empty function. |
void |
mouseMoved(java.awt.event.MouseEvent me)
Empty function. |
void |
mousePressed(java.awt.event.MouseEvent me)
Adds a new TransferPoint if control is pressed or selects an existing point. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Empty function. |
void |
paintComponent(java.awt.Graphics g)
Repaints the LineDrawPanel. |
void |
setHistogram(float[] histogramNormalized)
Stretches a normalized histogram so that its height matches the height of the LineDrawPanel and plots it in the background of the LineDrawPanel. |
boolean |
setSelectedGrayValue(java.lang.String grayValueStr)
Returns true if the gray-value of the selected TransferPoint can be changed to a specified value. |
boolean |
setSelectedOpacity(java.lang.String opacityStr)
Returns true if the opactiy-value of the selected TransferPoint can be changed to a specified value. |
void |
setSelectedPoint(java.lang.String grayValueStr,
java.lang.String opacityStr)
Is called when the user changes the values of a selected TransferPoint in the textboxes and applies the changes. |
void |
tellListenerNoSelection()
Is called when the user clicks on a color-point, that was not selected before. |
void |
tellListenerSelectionChanged()
Is called when the user clicks on a color-point, that was not selected before. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LineDrawPanel()
Method Detail |
---|
public void init()
public java.util.LinkedList<TransferPoint> getPoints()
public void fTOpened()
public void addActionListener(java.awt.event.ActionListener listener)
listener
- The ActionListener which is attached.public void setHistogram(float[] histogramNormalized)
histogramNormalized
- normalized histogram in form of a float-array.public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public int getSelectedGrayValue()
public int getSelectedOpacityValue()
public boolean setSelectedGrayValue(java.lang.String grayValueStr)
grayValueStr
- new gray-value in string-form of the TransferPoint
public boolean setSelectedOpacity(java.lang.String opacityStr)
opacityStr
- new opacity-value in string-form of the TransferPoint
public void setSelectedPoint(java.lang.String grayValueStr, java.lang.String opacityStr)
grayValueStr
- gray-value in string form.opacityStr
- opacity-value in string form.public void deleteSelectedPoint()
public void tellListenerSelectionChanged()
public void tellListenerNoSelection()
public void mousePressed(java.awt.event.MouseEvent me)
mousePressed
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent me)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseDragMoved(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void keyPressed(java.awt.event.KeyEvent e)
public void keyReleased(java.awt.event.KeyEvent e)
public void keyTyped(java.awt.event.KeyEvent e)
public static float[] getInterpolatedOpacity()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |