public class Dashboard extends JPanel implements Scrollable
Dashboard
is the container that contain the GadgetContainer
s. GadgetContainer
contains the GadgetComponent
. Ideally, we would like Dashboard
to contain the gadget
directly without the help of the gadget container in between. It will require a customized layout manager which we
currently don't have. So right now we set the dashboard to grid layout and add gadget container to this grid layout.
Each gadget container is using JideBoxLayout.JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static int |
COMPONENT_MAXIMIZED
The value return by
getColumnIndex(javax.swing.JComponent) if the component is maximized
GadgetComponent. |
static int |
H_GAP |
static String |
PROPERTY_COLUMN_COUNT |
static String |
PROPERTY_ICON |
static String |
PROPERTY_KEY |
static String |
PROPERTY_TITLE |
static int |
V_GAP |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
Dashboard() |
Dashboard(String key) |
Dashboard(String key,
String title) |
Dashboard(String key,
String title,
Icon icon) |
Dashboard(String key,
String title,
Icon icon,
int columnCount) |
Dashboard(String key,
String title,
int columnCount) |
Modifier and Type | Method and Description |
---|---|
void |
addPlaceHolder() |
void |
addPlaceHolder(Object constraints) |
void |
addPlaceHolder(PlaceHolder placeHolder,
Object constraints) |
protected PlaceHolder |
createDefaultPlaceHolder() |
protected JPanel |
createMaximizedGadgetContainer()
Create maximized gadget container.
|
protected JPanel |
createNormalGadgetContainer()
Deprecated.
replaced by
createNormalGadgetContainer(boolean) |
protected JPanel |
createNormalGadgetContainer(boolean columnResizable)
Create normal gadget container.
|
protected JPanel |
createSubpanel()
Creates the panel for each column.
|
void |
doLayout() |
int |
getColumnCount()
Gets the number of columns.
|
int |
getColumnIndex(JComponent gadgetComponent)
Get the column index of the GadgetComponent instance inside the dashboard.
|
protected Component |
getComponentAtLeft(Point p) |
protected Component |
getComponentAtTop(Point p) |
protected Object |
getComponentConstraints(int index)
Gets the constraints defined in the layout while adding the component into the layout.
|
protected LayoutManager |
getDashboardLayout(Container pane) |
static int |
getDefaultColumnCount()
Gets the default column count.
|
GadgetComponent[] |
getGadgetComponents()
Gets all GadgetComponents inside the dashboard.
|
Container |
getGadgetContainer(int column)
Get the GadgetContainer instance in the designated column.
|
Icon |
getIcon()
Gets the icon for the dashboard.
|
protected ImageIcon |
getImageIcon(String name)
Gets the image icons that is used in Dashboard.
|
String |
getKey()
Gets the key of this dashboard.
|
PredefinedLayoutAdapter |
getLayoutAdapter()
Gets the layout adapter.
|
LayoutManager |
getPredefinedLayout()
Gets predefined layout for the normal gadget container.
|
Dimension |
getPreferredScrollableViewportSize() |
int |
getRowIndex(JComponent gadgetComponent)
Get the row index of the GadgetComponent instance inside the dashboard.
|
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction) |
boolean |
getScrollableTracksViewportHeight() |
boolean |
getScrollableTracksViewportWidth() |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction) |
Map<String,String> |
getSettings()
Gets the settings.
|
String |
getTitle()
Gets the title of this dashboard.
|
protected void |
initDashboard()
Initializes the dashboard.
|
boolean |
isColumnResizable()
Get the flag indicating if the column is resizable.
|
boolean |
isPredefinedLayoutSet()
Checks if the predefined layout is configured.
|
boolean |
isRowResizable() |
boolean |
isShowGripper()
Get the flag indicating if Dashboard will show the gripper.
|
void |
maximizeGadget(GadgetComponent component)
Deprecated.
replaced by
maximizeGadgetComponent(GadgetComponent) |
void |
maximizeGadget(int column,
int row)
Deprecated.
replaced by
maximizeGadgetComponent(int, int) |
void |
maximizeGadgetComponent(GadgetComponent component)
Maximize the designated GadgetComponent.
|
void |
maximizeGadgetComponent(int index) |
void |
maximizeGadgetComponent(int column,
int row)
Maximize the GadgetComponent in designated column and row.
|
void |
removePredefinedGadgetPosition(int index) |
void |
restoreGadget()
Deprecated.
replaced by
restoreGadgetComponent() |
void |
restoreGadgetComponent()
Restore the maximized GadgetComponent.
|
void |
setColumnCount(int columnCount)
Sets the column count.
|
void |
setColumnResizable(boolean columnResizable)
Set the flag indicating if the column is resizable.
|
static void |
setDefaultColumnCount(int defaultColumnCount)
Sets the default column count.
|
void |
setIcon(Icon icon)
Sets the icon for the dashboard.
|
void |
setKey(String key)
Sets the key.
|
void |
setLayoutAdapter(PredefinedLayoutAdapter layoutAdapter)
Sets the layout adapter.
|
void |
setPredefinedLayout(LayoutManager predefinedLayout)
Sets predefined layout for the normal gadget container.
|
void |
setRowResizable(boolean rowResizable) |
void |
setSettings(Map<String,String> settings) |
void |
setShowGripper(boolean showGripper)
Set the flag indicating if Dashboard will show the gripper.
|
void |
setTitle(String title)
Sets the title.
|
void |
showMaximizedGadgetContainer()
Show maximized gadget container.
|
void |
showNormalGadgetContainer()
Show normal gadget container.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, 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, 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, transferFocusBackward, transferFocusUpCycle
public static final int H_GAP
public static final int V_GAP
public static final String PROPERTY_KEY
public static final String PROPERTY_TITLE
public static final String PROPERTY_ICON
public static final String PROPERTY_COLUMN_COUNT
public static final int COMPONENT_MAXIMIZED
getColumnIndex(javax.swing.JComponent)
if the component is maximized
GadgetComponent.public Dashboard()
public Dashboard(String key)
public static int getDefaultColumnCount()
setDefaultColumnCount(int)
public static void setDefaultColumnCount(int defaultColumnCount)
defaultColumnCount
- the new default column count.protected void initDashboard()
public int getColumnIndex(JComponent gadgetComponent)
gadgetComponent
- the gadget component instanceCOMPONENT_MAXIMIZED
if it is
maximized.public int getRowIndex(JComponent gadgetComponent)
gadgetComponent
- the gadget component instanceCOMPONENT_MAXIMIZED
if it is maximized.@Deprecated protected JPanel createNormalGadgetContainer()
createNormalGadgetContainer(boolean)
protected JPanel createNormalGadgetContainer(boolean columnResizable)
columnResizable
- if the column is resizable.protected LayoutManager getDashboardLayout(Container pane)
public void addPlaceHolder()
public void addPlaceHolder(Object constraints)
public void addPlaceHolder(PlaceHolder placeHolder, Object constraints)
public void removePredefinedGadgetPosition(int index)
protected PlaceHolder createDefaultPlaceHolder()
protected ImageIcon getImageIcon(String name)
IconsFactory
to get the image icons.
Subclass can override this method to provide their own icon. The the value of the name parameter will be
"icons/dashboard.png".name
- the icon nameprotected JPanel createMaximizedGadgetContainer()
public void showNormalGadgetContainer()
public void showMaximizedGadgetContainer()
@Deprecated public void maximizeGadget(GadgetComponent component)
maximizeGadgetComponent(GadgetComponent)
component
- the gadget componentpublic void maximizeGadgetComponent(GadgetComponent component)
component
- the gadget component@Deprecated public void maximizeGadget(int column, int row)
maximizeGadgetComponent(int, int)
column
- the column indexrow
- the row indexpublic void maximizeGadgetComponent(int index)
public void maximizeGadgetComponent(int column, int row)
column
- the column indexrow
- the row index@Deprecated public void restoreGadget()
restoreGadgetComponent()
public void restoreGadgetComponent()
public void setShowGripper(boolean showGripper)
JideSplitPane.setShowGripper(boolean)
.showGripper
- the flagpublic boolean isShowGripper()
JideSplitPane.isShowGripper()
is true. Otherwise false.protected JPanel createSubpanel()
public int getColumnCount()
public void setColumnCount(int columnCount)
columnCount
- the new column count.public String getTitle()
GadgetManager
.public void setTitle(String title)
title
- the new title.public String getKey()
public void setKey(String key)
key
- the new key.public Icon getIcon()
public void setIcon(Icon icon)
icon
- the iconpublic Map<String,String> getSettings()
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface Scrollable
public GadgetComponent[] getGadgetComponents()
public Container getGadgetContainer(int column)
column
- the column indexpublic boolean isColumnResizable()
public void setColumnResizable(boolean columnResizable)
columnResizable
- the flagpublic boolean isRowResizable()
public void setRowResizable(boolean rowResizable)
public void setPredefinedLayout(LayoutManager predefinedLayout)
setLayoutAdapter(PredefinedLayoutAdapter)
to have layout adapter defined to have this
feature working.predefinedLayout
- the layout managersetLayoutAdapter(PredefinedLayoutAdapter)
public LayoutManager getPredefinedLayout()
public boolean isPredefinedLayoutSet()
public void setLayoutAdapter(PredefinedLayoutAdapter layoutAdapter)
layoutAdapter
- the layout adapterpublic PredefinedLayoutAdapter getLayoutAdapter()
protected Object getComponentConstraints(int index)
index
- the index of the child component