Synergy Home Page

au.edu.swin.synergy.plugin.diagram
Class BDrawablePalette

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--au.edu.swin.synergy.plugin.diagram.BDrawablePalette

public class BDrawablePalette
extends JPanel
implements ActionListener

class BDrawablePalette - provides a tool palette containing BDrawables, that the user can select from..

Author:
Imron Alston
Copyright Belongs To:
team synergy 1999
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
protected  ButtonGroup buttonGroup
          a button group, so only 1 button is selected at a time..
protected  JPanel buttonPanel
          the panel containing all the buttons *
protected  Vector buttons
          Vector holding all the buttons displayed on the panel.
protected  JScrollPane buttonScroll
          a scroll pane for the panel containing all the buttons *
protected  BDrawableButton curSel
          The currently selected button *
protected  Vector drawables
          Vector containing all of the drawables on the buttons.
protected  FlowLayout flowLayout
          the flow layout of the panel *
protected static int kDefaultHGap
          the default size of the horizontal gap between the buttons on the panel *
protected static int kDefaultVGap
          the default size of the vertical gap between the buttons on the panel *
protected  ImageIcon pointer
           
protected  JToggleButton pointerButton
          the pointer button
 
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
 
Constructor Summary
BDrawablePalette()
          Please complete the missing tags for BGroupPalette
BDrawablePalette(int hGap, int vGap)
          Please complete the missing tags for BGroupPalette
 
Method Summary
 void actionPerformed(ActionEvent e)
          Handler for the pressing of buttons.
 void cleanup()
          Removes any unused buttons from the button vector.
 BDrawable getSelectedDrawable()
          Gets the currently selected BDrawable Please complete the missing tags for getSelectedDrawable
 void resetCurSel()
           
 void reshape(int x, int y, int w, int h)
          Please complete the missing tags for reshape
 void setDisabled(boolean b)
           
 void setDrawables(Vector drawables)
          Sets the shapes of the buttons in the tool palette to a corresponding shape from a shape vector.
 void setHGap(int hGap)
          Sets the horizontal gap between the buttons.
 void setVGap(int vGap)
          Sets the vertical gap between the buttons.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kDefaultHGap

protected static final int kDefaultHGap
the default size of the horizontal gap between the buttons on the panel *

kDefaultVGap

protected static final int kDefaultVGap
the default size of the vertical gap between the buttons on the panel *

buttonPanel

protected JPanel buttonPanel
the panel containing all the buttons *

flowLayout

protected FlowLayout flowLayout
the flow layout of the panel *

buttonScroll

protected JScrollPane buttonScroll
a scroll pane for the panel containing all the buttons *

buttonGroup

protected ButtonGroup buttonGroup
a button group, so only 1 button is selected at a time.. *

buttons

protected Vector buttons
Vector holding all the buttons displayed on the panel. *

drawables

protected Vector drawables
Vector containing all of the drawables on the buttons. *

curSel

protected BDrawableButton curSel
The currently selected button *

pointerButton

protected JToggleButton pointerButton
the pointer button

pointer

protected ImageIcon pointer
Constructor Detail

BDrawablePalette

public BDrawablePalette(int hGap,
                        int vGap)
Please complete the missing tags for BGroupPalette
Parameters:
-  

BDrawablePalette

public BDrawablePalette()
Please complete the missing tags for BGroupPalette
Parameters:
-  
Method Detail

getSelectedDrawable

public BDrawable getSelectedDrawable()
Gets the currently selected BDrawable Please complete the missing tags for getSelectedDrawable
Parameters:
-  
Returns:
 
Pre Condition:
 
Post Condition:
 

resetCurSel

public void resetCurSel()

setDisabled

public void setDisabled(boolean b)

setDrawables

public void setDrawables(Vector drawables)
Sets the shapes of the buttons in the tool palette to a corresponding shape from a shape vector. If there aren't sufficient buttons, then new buttons are created to fill demand.
Parameters:
Vector - drawables - a vector containing the BDrawable to set the buttons to. Please complete the missing tags for setGroups
Returns:
 
Pre Condition:
 
Post Condition:
 

setHGap

public void setHGap(int hGap)
Sets the horizontal gap between the buttons. Please complete the missing tags for setHGap
Parameters:
-  
Returns:
 
Pre Condition:
 
Post Condition:
 

setVGap

public void setVGap(int vGap)
Sets the vertical gap between the buttons. Please complete the missing tags for setVGap
Parameters:
-  
Returns:
 
Pre Condition:
 
Post Condition:
 

reshape

public void reshape(int x,
                    int y,
                    int w,
                    int h)
Please complete the missing tags for reshape
Parameters:
-  
Returns:
 
Overrides:
reshape in class JComponent
Pre Condition:
 
Post Condition:
 

actionPerformed

public void actionPerformed(ActionEvent e)
Handler for the pressing of buttons. Please complete the missing tags for actionPerformed
Specified by:
actionPerformed in interface ActionListener
Parameters:
-  
Returns:
 
Pre Condition:
 
Post Condition:
 

cleanup

public void cleanup()
Removes any unused buttons from the button vector. Removes the unused buttons from the button panel. Removes the unused buttons from the button group. Calls cleanup on the unused buttons. Trims the button Vector's capacity. Please complete the missing tags for cleanup
Parameters:
-  
Returns:
 
Pre Condition:
 
Post Condition:
 

Synergy Home Page