|
JHotDraw 7.0.9 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.draw.action.ButtonFactory
public class ButtonFactory
ButtonFactory.
Field Summary | |
---|---|
static java.util.Map<java.lang.String,java.awt.Color> |
DEFAULT_COLORS
|
Method Summary | |
---|---|
static void |
addAlignmentButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor)
Creates toolbar buttons and adds them to the specified JToolBar |
static void |
addAttributesButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor)
Creates toolbar buttons and adds them to the specified JToolBar |
static void |
addColorButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor)
|
static void |
addFontButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor)
|
static javax.swing.JToggleButton |
addSelectionToolTo(javax.swing.JToolBar tb,
DrawingEditor editor)
|
static javax.swing.JToggleButton |
addSelectionToolTo(javax.swing.JToolBar tb,
DrawingEditor editor,
java.util.Collection<javax.swing.Action> drawingActions,
java.util.Collection<javax.swing.Action> selectionActions)
|
static void |
addStrokeButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor)
|
static javax.swing.JToggleButton |
addToolTo(javax.swing.JToolBar tb,
DrawingEditor editor,
Tool tool,
java.lang.String labelKey,
ResourceBundleUtil labels)
Method addSelectionToolTo must have been invoked prior to this on the JToolBar. |
static void |
addZoomButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor)
|
static javax.swing.JButton |
createApplyAttributesButton(DrawingEditor editor)
Creates a button that applies the default attributes of the editor to the current selection. |
static java.util.Collection<javax.swing.Action> |
createDrawingActions(DrawingEditor editor)
|
static JPopupButton |
createEditorColorButton(DrawingEditor editor,
AttributeKey attributeKey,
java.util.Map<java.lang.String,java.awt.Color> colorMap,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels)
Creates a color button, with an action region and a popup menu. |
static JPopupButton |
createEditorColorButton(DrawingEditor editor,
AttributeKey attributeKey,
java.util.Map<java.lang.String,java.awt.Color> colorMap,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
Creates a color button, with an action region and a popup menu. |
static JPopupButton |
createEditorColorButton(DrawingEditor editor,
AttributeKey attributeKey,
java.util.Map<java.lang.String,java.awt.Color> colorMap,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape)
Creates a color button, with an action region and a popup menu. |
static JPopupButton |
createFontButton(DrawingEditor editor)
|
static JPopupButton |
createFontButton(DrawingEditor editor,
ResourceBundleUtil labels)
|
static javax.swing.JButton |
createFontStyleBoldButton(DrawingEditor editor)
|
static javax.swing.JButton |
createFontStyleBoldButton(DrawingEditor editor,
ResourceBundleUtil labels)
|
static javax.swing.JButton |
createFontStyleItalicButton(DrawingEditor editor)
|
static javax.swing.JButton |
createFontStyleItalicButton(DrawingEditor editor,
ResourceBundleUtil labels)
|
static javax.swing.JButton |
createFontStyleUnderlineButton(DrawingEditor editor)
|
static javax.swing.JButton |
createFontStyleUnderlineButton(DrawingEditor editor,
ResourceBundleUtil labels)
|
static javax.swing.JButton |
createPickAttributesButton(DrawingEditor editor)
|
static java.util.Collection<javax.swing.Action> |
createSelectionActions(DrawingEditor editor)
|
static JPopupButton |
createSelectionColorButton(DrawingEditor editor,
AttributeKey attributeKey,
java.util.Map<java.lang.String,java.awt.Color> colorMap,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels)
|
static JPopupButton |
createSelectionColorButton(DrawingEditor editor,
AttributeKey attributeKey,
java.util.Map<java.lang.String,java.awt.Color> colorMap,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
|
static JPopupButton |
createSelectionColorButton(DrawingEditor editor,
AttributeKey attributeKey,
java.util.Map<java.lang.String,java.awt.Color> colorMap,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape)
Creates a color button, with an action region and a popup menu. |
static JPopupButton |
createStrokeCapButton(DrawingEditor editor)
|
static JPopupButton |
createStrokeCapButton(DrawingEditor editor,
ResourceBundleUtil labels)
|
static JPopupButton |
createStrokeDashesButton(DrawingEditor editor)
|
static JPopupButton |
createStrokeDashesButton(DrawingEditor editor,
double[][] dashes)
|
static JPopupButton |
createStrokeDashesButton(DrawingEditor editor,
double[][] dashes,
ResourceBundleUtil labels)
|
static JPopupButton |
createStrokeDashesButton(DrawingEditor editor,
ResourceBundleUtil labels)
|
static JPopupButton |
createStrokeDecorationButton(DrawingEditor editor)
|
static JPopupButton |
createStrokeJoinButton(DrawingEditor editor)
|
static JPopupButton |
createStrokeJoinButton(DrawingEditor editor,
ResourceBundleUtil labels)
|
static JPopupButton |
createStrokePlacementButton(DrawingEditor editor)
|
static JPopupButton |
createStrokeTypeButton(DrawingEditor editor)
|
static JPopupButton |
createStrokeWidthButton(DrawingEditor editor)
|
static JPopupButton |
createStrokeWidthButton(DrawingEditor editor,
double[] widths)
|
static JPopupButton |
createStrokeWidthButton(DrawingEditor editor,
double[] widths,
ResourceBundleUtil labels)
|
static JPopupButton |
createStrokeWidthButton(DrawingEditor editor,
ResourceBundleUtil labels)
|
static javax.swing.AbstractButton |
createToggleGridButton(DrawingEditor editor)
Creates toolbar buttons and adds them to the specified JToolBar |
static javax.swing.AbstractButton |
createToggleGridButton(DrawingView view)
Creates toolbar buttons and adds them to the specified JToolBar |
static javax.swing.AbstractButton |
createZoomButton(DrawingEditor editor)
|
static javax.swing.AbstractButton |
createZoomButton(DrawingView view)
|
static javax.swing.AbstractButton |
createZoomButton(DrawingView view,
double[] factors)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.Map<java.lang.String,java.awt.Color> DEFAULT_COLORS
Method Detail |
---|
public static java.util.Collection<javax.swing.Action> createDrawingActions(DrawingEditor editor)
public static java.util.Collection<javax.swing.Action> createSelectionActions(DrawingEditor editor)
public static javax.swing.JToggleButton addSelectionToolTo(javax.swing.JToolBar tb, DrawingEditor editor)
public static javax.swing.JToggleButton addSelectionToolTo(javax.swing.JToolBar tb, DrawingEditor editor, java.util.Collection<javax.swing.Action> drawingActions, java.util.Collection<javax.swing.Action> selectionActions)
public static javax.swing.JToggleButton addToolTo(javax.swing.JToolBar tb, DrawingEditor editor, Tool tool, java.lang.String labelKey, ResourceBundleUtil labels)
public static void addZoomButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static javax.swing.AbstractButton createZoomButton(DrawingEditor editor)
public static javax.swing.AbstractButton createZoomButton(DrawingView view)
public static javax.swing.AbstractButton createZoomButton(DrawingView view, double[] factors)
public static void addAttributesButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static void addColorButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static JPopupButton createEditorColorButton(DrawingEditor editor, AttributeKey attributeKey, java.util.Map<java.lang.String,java.awt.Color> colorMap, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the default color.colorMap
- A map with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.public static JPopupButton createEditorColorButton(DrawingEditor editor, AttributeKey attributeKey, java.util.Map<java.lang.String,java.awt.Color> colorMap, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the default color.colorMap
- A map with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.public static JPopupButton createEditorColorButton(DrawingEditor editor, AttributeKey attributeKey, java.util.Map<java.lang.String,java.awt.Color> colorMap, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the default color.colorMap
- A map with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.colorShape
- This shape is superimposed on the icon of the button.
The shape is drawn with the default color of the DrawingEditor.public static JPopupButton createSelectionColorButton(DrawingEditor editor, AttributeKey attributeKey, java.util.Map<java.lang.String,java.awt.Color> colorMap, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels)
public static JPopupButton createSelectionColorButton(DrawingEditor editor, AttributeKey attributeKey, java.util.Map<java.lang.String,java.awt.Color> colorMap, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
public static JPopupButton createSelectionColorButton(DrawingEditor editor, AttributeKey attributeKey, java.util.Map<java.lang.String,java.awt.Color> colorMap, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the default color.colorMap
- A map with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.colorShape
- This shape is superimposed on the icon of the button.
The shape is drawn with the default color of the DrawingEditor.public static void addStrokeButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static JPopupButton createStrokeWidthButton(DrawingEditor editor)
public static JPopupButton createStrokeWidthButton(DrawingEditor editor, ResourceBundleUtil labels)
public static JPopupButton createStrokeWidthButton(DrawingEditor editor, double[] widths)
public static JPopupButton createStrokeWidthButton(DrawingEditor editor, double[] widths, ResourceBundleUtil labels)
public static JPopupButton createStrokeDecorationButton(DrawingEditor editor)
public static JPopupButton createStrokeDashesButton(DrawingEditor editor)
public static JPopupButton createStrokeDashesButton(DrawingEditor editor, ResourceBundleUtil labels)
public static JPopupButton createStrokeDashesButton(DrawingEditor editor, double[][] dashes)
public static JPopupButton createStrokeDashesButton(DrawingEditor editor, double[][] dashes, ResourceBundleUtil labels)
public static JPopupButton createStrokeTypeButton(DrawingEditor editor)
public static JPopupButton createStrokePlacementButton(DrawingEditor editor)
public static void addFontButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static JPopupButton createFontButton(DrawingEditor editor)
public static JPopupButton createFontButton(DrawingEditor editor, ResourceBundleUtil labels)
public static javax.swing.JButton createFontStyleBoldButton(DrawingEditor editor)
public static javax.swing.JButton createFontStyleBoldButton(DrawingEditor editor, ResourceBundleUtil labels)
public static javax.swing.JButton createFontStyleItalicButton(DrawingEditor editor)
public static javax.swing.JButton createFontStyleItalicButton(DrawingEditor editor, ResourceBundleUtil labels)
public static javax.swing.JButton createFontStyleUnderlineButton(DrawingEditor editor)
public static javax.swing.JButton createFontStyleUnderlineButton(DrawingEditor editor, ResourceBundleUtil labels)
public static void addAlignmentButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static javax.swing.AbstractButton createToggleGridButton(DrawingEditor editor)
public static javax.swing.AbstractButton createToggleGridButton(DrawingView view)
public static JPopupButton createStrokeCapButton(DrawingEditor editor)
public static JPopupButton createStrokeCapButton(DrawingEditor editor, ResourceBundleUtil labels)
public static JPopupButton createStrokeJoinButton(DrawingEditor editor)
public static JPopupButton createStrokeJoinButton(DrawingEditor editor, ResourceBundleUtil labels)
public static javax.swing.JButton createPickAttributesButton(DrawingEditor editor)
public static javax.swing.JButton createApplyAttributesButton(DrawingEditor editor)
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |