org.softsmithy.lib.swing
Class JCustomizerPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.softsmithy.lib.swing.JStyledPanel
                      extended by org.softsmithy.lib.swing.customizer.AbstractCustomizer
                          extended by org.softsmithy.lib.swing.JCustomizerPane
All Implemented Interfaces:
MouseListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, Styleable

public class JCustomizerPane
extends AbstractCustomizer
implements MouseListener

Author:
puce
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
JCustomizerPane()
          Creates new form JCustomizerPane
 
Method Summary
 void addComponentLayoutListener(Component component, ComponentLayoutListener listener)
           
 void addComponentLayoutListener(ComponentLayoutListener listener)
           
 void addCustomizer(JCustomizer customizer, CustomizerConstraints constraints)
           
protected  void addImpl(Component comp, Object constraints, int index)
          Adds the specified component to this container at the specified index.
 Color getActiveBorderColor()
          Getter for property activeBorderColor.
 CustomizerBar getCustomizerBar()
          Getter for property customizerBar.
 CustomizerLayout getCustomizerLayout()
           
 JCustomizer[] getCustomizers()
           
 Color getDefaultNormalCustomizerBorderColor()
          Getter for property defaultNormalCustomizerBorderColor.
 Color getDefaultSelectedCustomizerBorderColor()
          Getter for property defaultSelectedCustomizerBorderColor.
 Color getInactiveBorderColor()
          Getter for property inactiveBorderColor.
 JCustomizer[] getIntersectedCustomizers(Rectangle2D rectangle)
           
 Color getLayoutHelpColor()
          Getter for property layoutHelpColor.
 SelectionManager getSelectionManager()
          Getter for property selectionManager.
 boolean isActivationBorderEnabled()
          Getter for property activationBorderEnabled.
 boolean isActive()
          Getter for property active.
 boolean isShowingLayoutHelp()
          Getter for property showingConstraints.
 void mouseClicked(MouseEvent e)
          Invoked when the mouse button has been clicked (pressed and released) on a component.
 void mouseEntered(MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(MouseEvent e)
          Invoked when the mouse exits a component.
 void mousePressed(MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(MouseEvent e)
          Invoked when a mouse button has been released on a component.
protected  void paintComponent(Graphics g)
          Calls the UI delegate's paint method, if the UI delegate is non-null.
 void removeComponentLayoutListener(Component component, ComponentLayoutListener listener)
           
 void removeComponentLayoutListener(ComponentLayoutListener listener)
           
 void setAbsoluteCustomizerBounds(JCustomizer customizer, Rectangle bounds)
           
 void setActivationBorderEnabled(boolean activationBorderEnabled)
          Setter for property activationBorderEnabled.
 void setActive(boolean active)
          Setter for property active.
 void setActiveBorderColor(Color activeBorderColor)
          Setter for property activeBorderColor.
 void setCustomizerBar(CustomizerBar customizerBar)
          Setter for property customizerBar.
 void setCustomizerLayout(CustomizerLayout cl)
           
 void setDefaultNormalCustomizerBorderColor(Color defaultNormalCustomizerBorderColor)
          Setter for property defaultNormalCustomizerBorderColor.
 void setDefaultSelectedCustomizerBorderColor(Color defaultSelectedCustomizerBorderColor)
          Setter for property defaultSelectedCustomizerBorderColor.
 void setInactiveBorderColor(Color inactiveBorderColor)
          Setter for property inactiveBorderColor.
 void setLayout(LayoutManager mgr)
          Sets the layout manager for this container.
 void setLayoutHelpColor(Color layoutHelpColor)
          Setter for property layoutHelpColor.
 void setSelectionManager(SelectionManager selectionManager)
          Setter for property selectionManager.
 void setShowingLayoutHelp(boolean showingLayoutHelp)
          Setter for property showingConstraints.
 
Methods inherited from class org.softsmithy.lib.swing.customizer.AbstractCustomizer
getCommonCustomizableProperties, getCustomizableProperties, setCustomizableProperties
 
Methods inherited from class org.softsmithy.lib.swing.JStyledPanel
getBackground, getDefaultBackground, getDefaultFont, getDefaultForeground, getFont, getForeground, getNoneStyle, getParentStyle, getStyle, isDefaultOpaque, isOpaque, setBackground, setDefaultBackground, setDefaultFont, setDefaultForeground, setDefaultOpaque, setFont, setForeground, setOpaque, setStyle
 
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, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, 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
 
Methods inherited from interface org.softsmithy.lib.swing.style.Styleable
addHierarchyListener, getParent, removeHierarchyListener
 

Constructor Detail

JCustomizerPane

public JCustomizerPane()
Creates new form JCustomizerPane

Method Detail

isShowingLayoutHelp

public boolean isShowingLayoutHelp()
Getter for property showingConstraints.

Returns:
Value of property showingConstraints.

setShowingLayoutHelp

public void setShowingLayoutHelp(boolean showingLayoutHelp)
Setter for property showingConstraints.

Parameters:
showingConstraints - New value of property showingConstraints.

paintComponent

protected void paintComponent(Graphics g)
Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate).

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoker super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in a non-opaque color. If you do not honor the opaque property you will likely see visual artifacts.

Overrides:
paintComponent in class JComponent
Parameters:
g - the Graphics object to protect
See Also:
JComponent.paint(java.awt.Graphics), ComponentUI

mouseClicked

public void mouseClicked(MouseEvent e)
Invoked when the mouse button has been clicked (pressed and released) on a component.

Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Invoked when the mouse enters a component.

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Invoked when the mouse exits a component.

Specified by:
mouseExited in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Invoked when a mouse button has been released on a component.

Specified by:
mouseReleased in interface MouseListener

getSelectionManager

public SelectionManager getSelectionManager()
Getter for property selectionManager.

Returns:
Value of property selectionManager.

mousePressed

public void mousePressed(MouseEvent e)
Invoked when a mouse button has been pressed on a component.

Specified by:
mousePressed in interface MouseListener

getCustomizerBar

public CustomizerBar getCustomizerBar()
Getter for property customizerBar.

Returns:
Value of property customizerBar.

setCustomizerBar

public void setCustomizerBar(CustomizerBar customizerBar)
Setter for property customizerBar.

Parameters:
customizerBar - New value of property customizerBar.

setSelectionManager

public void setSelectionManager(SelectionManager selectionManager)
Setter for property selectionManager.

Parameters:
selectionManager - New value of property selectionManager.

getCustomizers

public JCustomizer[] getCustomizers()

getIntersectedCustomizers

public JCustomizer[] getIntersectedCustomizers(Rectangle2D rectangle)

setLayout

public void setLayout(LayoutManager mgr)
Sets the layout manager for this container.

Overrides:
setLayout in class Container
Parameters:
mgr - the specified layout manager
See Also:
Container.doLayout(), Container.getLayout()

setCustomizerLayout

public void setCustomizerLayout(CustomizerLayout cl)

getCustomizerLayout

public CustomizerLayout getCustomizerLayout()

addImpl

protected void addImpl(Component comp,
                       Object constraints,
                       int index)
Adds the specified component to this container at the specified index. This method also notifies the layout manager to add the component to this container's layout using the specified constraints object via the addLayoutComponent method. The constraints are defined by the particular layout manager being used. For example, the BorderLayout class defines five constraints: BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST, BorderLayout.WEST, and BorderLayout.CENTER.

Note that if the component already exists in this container or a child of this container, it is removed from that container before being added to this container.

This is the method to override if a program needs to track every add request to a container as all other add methods defer to this one. An overriding method should usually include a call to the superclass's version of the method:

super.addImpl(comp, constraints, index)

Overrides:
addImpl in class Container
Parameters:
comp - the component to be added
constraints - an object expressing layout constraints for this component
index - the position in the container's list at which to insert the component, where -1 means append to the end
Throws:
IllegalArgumentException - if index is invalid
IllegalArgumentException - if adding the container's parent to itself
IllegalArgumentException - if adding a window to a container
Since:
JDK1.1
See Also:
Container.add(Component), Container.add(Component, int), Container.add(Component, java.lang.Object), LayoutManager, LayoutManager2

addCustomizer

public void addCustomizer(JCustomizer customizer,
                          CustomizerConstraints constraints)

setAbsoluteCustomizerBounds

public void setAbsoluteCustomizerBounds(JCustomizer customizer,
                                        Rectangle bounds)

addComponentLayoutListener

public void addComponentLayoutListener(ComponentLayoutListener listener)

addComponentLayoutListener

public void addComponentLayoutListener(Component component,
                                       ComponentLayoutListener listener)

removeComponentLayoutListener

public void removeComponentLayoutListener(ComponentLayoutListener listener)

removeComponentLayoutListener

public void removeComponentLayoutListener(Component component,
                                          ComponentLayoutListener listener)

isActive

public boolean isActive()
Getter for property active.

Returns:
Value of property active.

setActive

public void setActive(boolean active)
Setter for property active.

Parameters:
active - New value of property active.

isActivationBorderEnabled

public boolean isActivationBorderEnabled()
Getter for property activationBorderEnabled.

Returns:
Value of property activationBorderEnabled.

setActivationBorderEnabled

public void setActivationBorderEnabled(boolean activationBorderEnabled)
Setter for property activationBorderEnabled.

Parameters:
activationBorderEnabled - New value of property activationBorderEnabled.

getActiveBorderColor

public Color getActiveBorderColor()
Getter for property activeBorderColor.

Returns:
Value of property activeBorderColor.

setActiveBorderColor

public void setActiveBorderColor(Color activeBorderColor)
Setter for property activeBorderColor.

Parameters:
activeBorderColor - New value of property activeBorderColor.

getInactiveBorderColor

public Color getInactiveBorderColor()
Getter for property inactiveBorderColor.

Returns:
Value of property inactiveBorderColor.

setInactiveBorderColor

public void setInactiveBorderColor(Color inactiveBorderColor)
Setter for property inactiveBorderColor.

Parameters:
inactiveBorderColor - New value of property inactiveBorderColor.

getLayoutHelpColor

public Color getLayoutHelpColor()
Getter for property layoutHelpColor.

Returns:
Value of property layoutHelpColor.

setLayoutHelpColor

public void setLayoutHelpColor(Color layoutHelpColor)
Setter for property layoutHelpColor.

Parameters:
layoutHelpColor - New value of property layoutHelpColor.

getDefaultNormalCustomizerBorderColor

public Color getDefaultNormalCustomizerBorderColor()
Getter for property defaultNormalCustomizerBorderColor.

Returns:
Value of property defaultNormalCustomizerBorderColor.

setDefaultNormalCustomizerBorderColor

public void setDefaultNormalCustomizerBorderColor(Color defaultNormalCustomizerBorderColor)
Setter for property defaultNormalCustomizerBorderColor.

Parameters:
defaultNormalCustomizerBorderColor - New value of property defaultNormalCustomizerBorderColor.

getDefaultSelectedCustomizerBorderColor

public Color getDefaultSelectedCustomizerBorderColor()
Getter for property defaultSelectedCustomizerBorderColor.

Returns:
Value of property defaultSelectedCustomizerBorderColor.

setDefaultSelectedCustomizerBorderColor

public void setDefaultSelectedCustomizerBorderColor(Color defaultSelectedCustomizerBorderColor)
Setter for property defaultSelectedCustomizerBorderColor.

Parameters:
defaultSelectedCustomizerBorderColor - New value of property defaultSelectedCustomizerBorderColor.


Copyright © 2002-2011 SoftSmithy. All Rights Reserved.