|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jimm.datavision.gui.SectionWidget
public class SectionWidget
A section widget is the visual representation of a report section.
| Nested Class Summary | |
|---|---|
(package private) class |
SectionWidget.PopupListener
An inner class that handles display of the popup menu. |
| 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 | |
|---|---|
protected javax.swing.JMenuItem |
addGroup
|
protected static java.awt.Font |
DEFAULT_POPUP_FONT
|
protected javax.swing.JMenuItem |
deleteGroup
|
protected javax.swing.JMenuItem |
deleteSection
|
protected Designer |
designer
|
protected javax.swing.JMenuItem |
editSuppress
|
protected SectionFieldPanel |
fieldPanel
|
protected javax.swing.JMenuItem |
insertSection
|
protected SectionNameLabel |
label
|
static int |
LHS_WIDTH
|
protected java.lang.String |
name
|
protected javax.swing.JMenuItem |
nameItem
|
(package private) static java.awt.Color |
NORMAL_COLOR
|
protected javax.swing.JPopupMenu |
popup
|
protected java.lang.String |
popupName
|
protected Section |
section
|
(package private) static java.awt.Color |
SUPPRESSED_COLOR
|
protected javax.swing.JCheckBoxMenuItem |
togglePageBreak
|
| 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 | |
|---|---|
SectionWidget(Designer win,
Section sect,
java.lang.String name)
Constructor. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Performs some action based on the action command string (the menu item text). |
void |
addField(FieldWidget fw)
Adds field widget to panel. |
FieldWidget |
addTitleField(int x,
int width,
java.lang.String title)
Passes this request up to the design window. |
protected void |
buildDisplayName()
Constructs the section name widget that is displayed to the left of the section. |
protected void |
buildPopupMenu()
Builds the popup menu. |
(package private) void |
createNewTextField(java.awt.event.MouseEvent e)
Asks design window to create and accepts a new text field. |
(package private) void |
deselectAll()
Deselects all fields in all sections. |
(package private) void |
dragSelectedWidgets(int action,
java.awt.Point mouseScreenPos)
Tells the window to drag (move, resize) all selected fields. |
(package private) void |
editSuppression()
Toggles the suppressed flag of the section. |
protected void |
enablePopupMenuItems()
Modifies menu items based on the state of the section. |
Designer |
getDesigner()
Returns the design window containing this section widget |
SectionFieldPanel |
getFieldPanel()
|
int |
getHeight()
Returns the height of the section, including the resizer bar. |
int |
getMinSectionHeight()
Returns the minimum height the section needs to fit all of its fields. |
int |
getPaperWidth()
Returns the width of the report paper (the white part upon which fields are placed). |
Report |
getReport()
Returns the report we are representing. |
Section |
getSection()
Returns the section we are representing. |
SectionArea |
getSectionArea()
Returns the SectionArea of the Section (report header, page
footer, etc.) |
int |
getSectionHeight()
Returns the height of the report section. |
int |
getTotalWidth()
Returns the width of the section, including the left-hand side name. |
void |
growBy(int dy)
Resizes the section. |
void |
growToFit()
Grows this section widget to the minimum height required. |
(package private) void |
paperSizeChanged()
Resizes this widget. |
void |
performCommand(Command cmd)
Passes a command up to the design window for execution. |
(package private) void |
pickUp(java.awt.Point mouseScreenPos)
Passes on to the design window the request to pick up all selected fields for dragging (not just the specified field). |
(package private) void |
putDown(FieldWidget f,
java.awt.Point origScreenPos,
java.awt.Point mouseScreenPos)
Passes on to the design window the request to put down all fields being dragged (not just the specified field). |
void |
removeField(FieldWidget fw)
Removes field widget from panel, but do not change field model's relation with section model. |
void |
resizeBy(int dy,
SectionResizeCommand cmd)
Grows or shrinks the section widget and executes a command that allows this action to be undone/redone. |
(package private) void |
select(FieldWidget fieldWidget,
boolean makeSelected,
boolean deselectOthers)
Selects or deselcts a field widget, possibly deselecting all others everywhere. |
void |
setDisplayName(java.lang.String name)
Set the section display name. |
(package private) void |
setFieldVisibility(boolean newVisiblity,
FieldWidget fw)
Sets the visibility of all selected fields plus the one passed in. |
void |
setIgnoreKeys(boolean ignoreKeys)
Passes responsiblity up to the design window. |
void |
setPopupName(java.lang.String popupName)
Set the popup menu name, also displayed as first, disabled menu item. |
(package private) void |
showPopup(java.awt.event.MouseEvent e)
Displays popup menu, after enabling and disabling menu items. |
void |
shrinkToFit()
Shrinks this section widget to the minimum height required. |
(package private) void |
snapToGrid(Rectangle r)
Asks the design window to snap the rectangle to it's grid. |
(package private) void |
startStretching(java.awt.Point mouseScreenPos)
Passes on to the design window the request to start stretching all selected fields (not just the specified field). |
(package private) void |
stopStretching(FieldWidget f,
Rectangle origBounds)
Passes on to the design window the request to stop stretching all fields being stretched (not just the specified field). |
(package private) void |
togglePageBreak()
Toggles the page break flag of the section. |
| 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, 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, 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 |
| 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 LHS_WIDTH
protected static final java.awt.Font DEFAULT_POPUP_FONT
static final java.awt.Color NORMAL_COLOR
static final java.awt.Color SUPPRESSED_COLOR
protected java.lang.String name
protected java.lang.String popupName
protected Designer designer
protected Section section
protected SectionNameLabel label
protected SectionFieldPanel fieldPanel
protected javax.swing.JPopupMenu popup
protected javax.swing.JMenuItem nameItem
protected javax.swing.JMenuItem editSuppress
protected javax.swing.JCheckBoxMenuItem togglePageBreak
protected javax.swing.JMenuItem deleteGroup
protected javax.swing.JMenuItem addGroup
protected javax.swing.JMenuItem deleteSection
protected javax.swing.JMenuItem insertSection
| Constructor Detail |
|---|
public SectionWidget(Designer win,
Section sect,
java.lang.String name)
win - parent design windowsect - the report sectionname - a name such as "Report Header (a)"| Method Detail |
|---|
protected void buildPopupMenu()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerprotected void enablePopupMenuItems()
protected void buildDisplayName()
public void setDisplayName(java.lang.String name)
name - the new namepublic void setPopupName(java.lang.String popupName)
popupName - the new namepublic Report getReport()
public Section getSection()
public SectionArea getSectionArea()
SectionArea of the Section (report header, page
footer, etc.)
SectionAreapublic Designer getDesigner()
public int getPaperWidth()
public int getTotalWidth()
public int getHeight()
getHeight in class javax.swing.JComponentpublic int getSectionHeight()
public int getMinSectionHeight()
void paperSizeChanged()
void editSuppression()
void togglePageBreak()
public void shrinkToFit()
public void growToFit()
shrinkToFit, is always called as part of some other
operation.
public void growBy(int dy)
dy - delta y
public void resizeBy(int dy,
SectionResizeCommand cmd)
growBy(int) to grow
or shrink, then lets our window execute the command that remembers
the size change for later undo/redo.
The command does not change our height. It remembers the old and new heights for later undo/redo.
dy - delta heightcmd - a section resize commandperformCommand(jimm.datavision.gui.cmd.Command)public void performCommand(Command cmd)
cmd - a commandDesigner.performCommand(jimm.datavision.gui.cmd.Command)public void setIgnoreKeys(boolean ignoreKeys)
Designer.setIgnoreKeys(boolean)
public FieldWidget addTitleField(int x,
int width,
java.lang.String title)
x - where to place the titlewidth - how wide it should betitle - the string to display
Designer.addTitleField(int, int, java.lang.String)void pickUp(java.awt.Point mouseScreenPos)
FieldWidget.mousePressed(java.awt.event.MouseEvent).
mouseScreenPos - the location of the mouse in screen coordinatesDesigner.pickUp(java.awt.Point)
void putDown(FieldWidget f,
java.awt.Point origScreenPos,
java.awt.Point mouseScreenPos)
FieldWidget.mouseReleased(java.awt.event.MouseEvent).
f - the field in which the mouse has been clickedorigScreenPos - the original location of the field in screen
coordinatesmouseScreenPos - the location of the mouse in screen coordinatesDesigner.putDown(jimm.datavision.gui.FieldWidget, java.awt.Point, java.awt.Point)void startStretching(java.awt.Point mouseScreenPos)
FieldWidget.mousePressed(java.awt.event.MouseEvent).
mouseScreenPos - the location of the mouse in screen coordinatesDesigner.startStretching(java.awt.Point)
void stopStretching(FieldWidget f,
Rectangle origBounds)
FieldWidget.mouseReleased(java.awt.event.MouseEvent).
f - the field in which the mouse has been clickedorigBounds - the field's original boundsDesigner.putDown(jimm.datavision.gui.FieldWidget, java.awt.Point, java.awt.Point)
void dragSelectedWidgets(int action,
java.awt.Point mouseScreenPos)
action - a FieldWidget.ACTION_* constantmouseScreenPos - the location of the mouse in screen coordinatesFieldWidget.mouseDragged(java.awt.event.MouseEvent),
Designer.dragSelectedWidgets(int, java.awt.Point)
void select(FieldWidget fieldWidget,
boolean makeSelected,
boolean deselectOthers)
fieldWidget - a field widgetmakeSelected - if true, select this field; else
deselect itdeselectOthers - if true, all other fields in all
sections are deselected firstDesigner.select(jimm.datavision.gui.FieldWidget, boolean, boolean)void deselectAll()
Designer.deselectAll()public void addField(FieldWidget fw)
fw - field widget to addpublic void removeField(FieldWidget fw)
To delete a field widget completely, see Designer.deleteSelectedFields().
fw - field widget to removeaddField(jimm.datavision.gui.FieldWidget)public SectionFieldPanel getFieldPanel()
void snapToGrid(Rectangle r)
r - a rectangle
void setFieldVisibility(boolean newVisiblity,
FieldWidget fw)
FieldWidget.toggleVisibility(),
Designer.setFieldVisibility(boolean, jimm.datavision.gui.FieldWidget)void createNewTextField(java.awt.event.MouseEvent e)
Designer.createNewTextField(jimm.datavision.gui.SectionWidget, java.awt.event.MouseEvent)void showPopup(java.awt.event.MouseEvent e)
e - mouse event that caused popup to do its thing
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||