public class Contour extends javax.swing.JComponent implements IContour
Contour
is a lightweight component which only paints the outline of component when dragged. It is also
used as a placeholder for some information during dragging.
Notes: this class has to be public so that JIDE can use it in different packages, not meant to release to end user as
a public API. JIDE will not guarantee the class will remain as it is.javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
FULL_OUTLINE_MODE |
static int |
MIX_OUTLINE_MODE |
static int |
PARTIAL_OUTLINE_MODE |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
Contour()
Default Constructor.
|
Contour(int tabHeight)
Constructor with tab height.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup() |
java.awt.Component |
getAttachedComponent()
Gets the attached component of this contour.
|
int |
getAttachedSide()
Gets the side of the attached component which the contour is attached to.
|
java.awt.Component |
getGlassPane() |
int |
getOutlineMode() |
java.awt.Container |
getRelativeContainer() |
javax.swing.JComponent |
getSaveDraggedComponent()
Gets saved dragged component before the contour is hidden.
|
int |
getSaveMouseModifier()
Gets saved mouse modifier before the contour is hidden.
|
int |
getSaveX()
Gets saved X position of contour before it's hidden.
|
int |
getSaveY()
Gets saved Y position of contour before it's hidden.
|
int |
getTabHeight()
Gets tab height.
|
int |
getTabSide()
Gets the side of the tab.
|
boolean |
isAllowDocking()
Checks if docking is allowed.
|
boolean |
isChangeCursor() |
boolean |
isDoubleBuffered()
Returns whether this component should use a buffer to paint.
|
boolean |
isFloating()
Returns true if the contour is in floating mode.
|
boolean |
isSingle()
When you dragged a component, several other components could be dragged.
|
boolean |
isTabDocking()
Returns true if the contour is in tab-dock mode.
|
boolean |
isVisible()
Determines whether this component should be visible when its parent is visible.
|
void |
paint(java.awt.Graphics g)
Paint a rectangle or tab-shape using
DOTTED_STROKE |
void |
setAllowDocking(boolean allowDocking)
Sets the value of docking.
|
void |
setAttachedComponent(java.awt.Component attachedComponent)
Sets the attached components.
|
void |
setAttachedSide(int attachedSide)
Sets the side of the attached component which the contour is attached to.
|
void |
setBounds(int x,
int y,
int width,
int height)
Overwrite setBounds so that width and height are always even.
|
void |
setBounds(java.awt.Rectangle r)
Overwrite setBounds so that width and height are always even.
|
void |
setChangeCursor(boolean changeCursor) |
void |
setDraggingInformation(javax.swing.JComponent comp,
int saveX,
int saveY,
int saveMouseModifier)
Stores information before the contour is hidden.
|
void |
setFloating(boolean floating)
Sets the floating mode.
|
void |
setGlassPane(java.awt.Component glassPane) |
void |
setOutlineMode(int outlineMode) |
void |
setRelativeContainer(java.awt.Container relativeContainer) |
void |
setSingle(boolean single)
Sets the value of single.
|
void |
setTabDocking(boolean tabDocking)
Sets the tab-docking mode.
|
void |
setTabHeight(int tabHeight)
Sets the tab height.
|
void |
setTabSide(int tabSide)
Sets the side of the tab.
|
void |
setVisible(boolean aFlag)
Makes the component visible or invisible.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBounds, isLightweight
public static final int PARTIAL_OUTLINE_MODE
public static final int MIX_OUTLINE_MODE
public static final int FULL_OUTLINE_MODE
public Contour()
public Contour(int tabHeight)
tabHeight
- the tab heightpublic boolean isDoubleBuffered()
isDoubleBuffered
in class javax.swing.JComponent
public void paint(java.awt.Graphics g)
DOTTED_STROKE with width of WIDTH.
paint
in class javax.swing.JComponent
g
- public void setBounds(java.awt.Rectangle r)
public void setBounds(int x, int y, int width, int height)
DOTTED_STROKE
public int getTabHeight()
getTabHeight
in interface IContour
public void setTabHeight(int tabHeight)
setTabHeight
in interface IContour
tabHeight
- public boolean isTabDocking()
isTabDocking
in interface IContour
public void setTabDocking(boolean tabDocking)
setTabDocking
in interface IContour
tabDocking
- new modepublic int getTabSide()
getTabSide
in interface IContour
public void setTabSide(int tabSide)
setTabSide
in interface IContour
tabSide
- public boolean isFloating()
isFloating
in interface IContour
public void setFloating(boolean floating)
setFloating
in interface IContour
floating
- new modepublic java.awt.Component getAttachedComponent()
getAttachedComponent
in interface IContour
public void setAttachedComponent(java.awt.Component attachedComponent)
setAttachedComponent
in interface IContour
attachedComponent
- attached component to be setpublic int getAttachedSide()
getAttachedSide
in interface IContour
public void setAttachedSide(int attachedSide)
setAttachedSide
in interface IContour
attachedSide
- the new attached side to be setpublic boolean isSingle()
public void setSingle(boolean single)
public boolean isAllowDocking()
isAllowDocking
in interface IContour
true
if docking is allowed; false
otherwise.public void setAllowDocking(boolean allowDocking)
setAllowDocking
in interface IContour
allowDocking
- true
if docking is allowed; false
otherwise.public java.awt.Container getRelativeContainer()
getRelativeContainer
in interface IContour
public void setRelativeContainer(java.awt.Container relativeContainer)
setRelativeContainer
in interface IContour
public int getSaveX()
public int getSaveY()
public int getSaveMouseModifier()
getSaveMouseModifier
in interface IContour
public javax.swing.JComponent getSaveDraggedComponent()
getSaveDraggedComponent
in interface IContour
public void setDraggingInformation(javax.swing.JComponent comp, int saveX, int saveY, int saveMouseModifier)
setDraggingInformation
in interface IContour
comp
- the dragged componentsaveX
- X position of the contoursaveY
- Y position of the contoursaveMouseModifier
- mouse modifier in the MouseEventpublic void setVisible(boolean aFlag)
Component.setVisible
.setVisible
in interface IContour
setVisible
in class javax.swing.JComponent
aFlag
- true to make the component visible; false to make it invisiblepublic boolean isVisible()
Frame
objects.isVisible
in interface IContour
isVisible
in class java.awt.Component
true
if the component is visible, false
otherwisesetVisible(boolean)
public int getOutlineMode()
public void setOutlineMode(int outlineMode)
public java.awt.Component getGlassPane()
getGlassPane
in interface IContour
public void setGlassPane(java.awt.Component glassPane)
setGlassPane
in interface IContour
public boolean isChangeCursor()
public void setChangeCursor(boolean changeCursor)
setChangeCursor
in interface IContour