|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.cosylab.gui.components.AbstractDisplayerPanel
public abstract class AbstractDisplayerPanel
A container for simple displayers is able to display a small dispalyer
component together with an optional title in a vertical or horizontal
resizable layout. It also supports
com.cosylab.gui.components.util.PopupManager
and
com.cosylab.gui.components.customizer.Customizer
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
DYNAMIC_LAYOUT
Lays out components either horizontally or vertically according to the space available |
static int |
HORIZONTAL_LAYOUT
Lays out the components horizontaly. |
static int |
VERTICAL_LAYOUT
Lays out componetns vertically |
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
AbstractDisplayerPanel()
Constructs AbstractDisplayerPanel already containing the valueComponent . |
|
AbstractDisplayerPanel(java.lang.String title,
boolean titleVisible,
int layoutOrientation,
boolean resizable,
boolean enabled,
boolean enchanced,
int minTitleFontSize,
int maxTitleFontSize)
Constructs AbstractDisplayerPanel already containing the valueComponent with inital values. |
Method Summary | |
---|---|
AbstractCustomizerPanel |
getCustomizer()
Loads the default com.cosylab.gui.components.customizer.Customizer for this
displayer and returns it. |
int |
getLayoutOrientation()
Returns the current layout orientation setting. |
PopupManager |
getPopupManager()
Returns popum manager for adding popup actions. |
State |
getState()
Returns the current state of the component. |
java.lang.String |
getTitle()
Returns the title displayed beside the value component. |
protected javax.swing.JLabel |
getTitleComponent()
Returns the component to display the title of thi displayer. |
int |
getTitleMaximumFontSize()
Returns the maximum font size allowed. |
int |
getTitleMinimumFontSize()
Returns the minimum font size allowed. |
protected abstract javax.swing.JComponent |
getValueComponent()
Should return the component to display the value of this displayer. |
protected void |
internalSetEnabled()
|
protected void |
internalSetEnhanced()
|
protected void |
internalSetResizable()
|
protected void |
internalSetTitle()
|
boolean |
isDragEnabled()
Returns true if drag is enabled. |
boolean |
isDropEnabled()
Returns true if drop is enabled. |
boolean |
isEnhanced()
Determines whether the displayer panel is to be rendered enhanced. |
boolean |
isPopupEnabled()
Return true if the popup menu is enabled or false otherwise. |
boolean |
isResizable()
Determines wether the components inside the panel should resize together with the panel or should maintain their preferred sizes. |
boolean |
isTitleVisible()
Determines wether the title of this component is displayed beside the value component. |
protected void |
layoutDisplayer()
Lays out the displayer according to the set layout orientation. |
protected void |
layoutValue()
|
protected void |
layoutValueAndTitle()
|
void |
setBackground(java.awt.Color bg)
|
void |
setDragEnabled(boolean enabled)
Enables/disables mouse dragging. |
void |
setDropEnabled(boolean enabled)
Enable/disable the mouse drop. |
void |
setEnabled(boolean enabled)
Overriden to disable subcomponents. |
void |
setEnhanced(boolean b)
Sets the enhanced property of the displayer panel |
void |
setForeground(java.awt.Color fg)
|
void |
setLayoutOrientation(int i)
Sets the orientation tag determining how the title and value components should be layed out inside the panel. |
void |
setPopupEnabled(boolean enabled)
Enables or disables the popup menu. |
void |
setResizable(boolean b)
Sets the resizability of the title and value components of the panel. |
void |
setState(State state)
Sets the state to the component. |
void |
setTitle(java.lang.String value)
Sets the title to be displayed beside the value component. |
void |
setTitleMaximumFontSize(int max)
Sets the maximum title font size allowed. |
void |
setTitleMinimumFontSize(int min)
Sets the minimum title font size allowed. |
void |
setTitleVisible(boolean b)
Adds or removes the Title displayed beside the value component. |
void |
setTransferHandler(javax.swing.TransferHandler newHandler)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int HORIZONTAL_LAYOUT
public static final int VERTICAL_LAYOUT
public static final int DYNAMIC_LAYOUT
Constructor Detail |
---|
public AbstractDisplayerPanel()
valueComponent
.
public AbstractDisplayerPanel(java.lang.String title, boolean titleVisible, int layoutOrientation, boolean resizable, boolean enabled, boolean enchanced, int minTitleFontSize, int maxTitleFontSize)
valueComponent
with inital values. It is cheap to set
values now, since component is not in AWT containment.
title
- initial valuetitleVisible
- initial valuelayoutOrientation
- initial valueresizable
- initial valueenabled
- initial valueenchanced
- initial valueminTitleFontSize
- initial valuemaxTitleFontSize
- initial valueMethod Detail |
---|
public AbstractCustomizerPanel getCustomizer()
com.cosylab.gui.components.customizer.Customizer
for this
displayer and returns it.
public void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
enabled
- if the component is to be enabledpublic void setEnhanced(boolean b)
b
- whether to render in enhanced modepublic boolean isEnhanced()
public void setLayoutOrientation(int i)
i
- layout tag, valid values are HORIZONTAL_LAYOUT
,
VERTICAL_LAYOUT
, DYNAMIC_LAYOUT
java.lang.IllegalArgumentException
- if no applicable parameter is suppliedgetLayoutOrientation()
public int getLayoutOrientation()
Returns the current layout orientation setting.
Possible values are:
#HORIZONTAL_LAYOUT
- the title and value components are
displayed side by side horizontally
#VERTICAL_LAYOUT
- the title and value components are
displayed vertically, title above the value
#DYNAMIC_LAYOUT
- the orientation of the components inside
the panel is determined dynamically on the basisi of the components
preferred sizes so as to most affectivelly fill up the space available.
public PopupManager getPopupManager()
getPopupManager
in interface PopupManageable
PopupManageable.getPopupManager()
public boolean isPopupEnabled()
public void setPopupEnabled(boolean enabled)
enabled
- true if enable or false if disabledspublic void setResizable(boolean b)
b
- wether the title and value components should adjust their sizes
in accord with the size of the panel.isResizable()
public boolean isResizable()
Determines wether the components inside the panel should resize together with the panel or should maintain their preferred sizes.
When disabled, the size of the components inside the panel is determined according to the preferred size of the panel.
true
if the title and value components resize
accordingly with the size of the panel, false
otherwise.public void setState(State state)
setState
in interface StateOriginator
state
- to set.StateOriginator.setState(com.cosylab.application.state.State)
public State getState()
getState
in interface StateOriginator
StateOriginator.getState()
public void setTitle(java.lang.String value)
value
- title String to be displayedpublic java.lang.String getTitle()
public void setTitleVisible(boolean b)
b
- wether the title should be displayed or not.public boolean isTitleVisible()
true
if the title is displayed and
false
if not.protected javax.swing.JLabel getTitleComponent()
#DisplayerLayout
.
protected abstract javax.swing.JComponent getValueComponent()
valueComponent
to the AbstractDisplayerPanel. Subclasses
should thus use lazy initialization inside this method.
protected void internalSetEnabled()
protected void internalSetEnhanced()
protected void internalSetResizable()
protected void internalSetTitle()
protected void layoutDisplayer()
protected void layoutValue()
protected void layoutValueAndTitle()
public int getTitleMaximumFontSize()
public int getTitleMinimumFontSize()
public void setTitleMaximumFontSize(int max)
max
- public void setTitleMinimumFontSize(int min)
min
- public void setTransferHandler(javax.swing.TransferHandler newHandler)
setTransferHandler
in class javax.swing.JComponent
public void setDragEnabled(boolean enabled)
enabled
- public boolean isDragEnabled()
public void setDropEnabled(boolean enabled)
enabled
- public boolean isDropEnabled()
public void setBackground(java.awt.Color bg)
setBackground
in class javax.swing.JComponent
public void setForeground(java.awt.Color fg)
setForeground
in class javax.swing.JComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |