|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjimm.datavision.gui.FieldWidget
public class FieldWidget
A field widget is the visual representation of a text-based report field.
| Field Summary | |
|---|---|
protected int |
action
|
protected static int |
ACTION_INACTION
|
protected static int |
ACTION_MOVE
|
protected static int |
ACTION_POPPING_UP_MENU
|
protected static int |
ACTION_STRETCH_BOTTOM
|
protected static int |
ACTION_STRETCH_LEFT
|
protected static int |
ACTION_STRETCH_RIGHT
|
protected static int |
ACTION_STRETCH_TOP
|
protected boolean |
actionStartedYet
|
protected javax.swing.JMenuItem |
aggregatesMenuItem
|
protected javax.swing.JMenu |
alignSubmenu
|
protected static java.util.HashMap |
componentMap
|
protected javax.swing.JMenuItem |
formatMenuItem
|
protected static int |
GRAB_EDGE_WIDTH
|
protected static int |
MIN_SIZE
Minimum field with and height. |
protected boolean |
mouseChangedSelectedState
|
protected javax.swing.JMenuItem |
nameItem
|
protected javax.swing.JPopupMenu |
popup
|
protected static java.awt.Font |
POPUP_FONT
|
protected PreMoveInfo |
preMoveInfo
|
protected PreStretchInfo |
preStretchInfo
|
protected SectionWidget |
sectionWidget
|
protected boolean |
selected
|
protected javax.swing.JMenuItem |
showOrHide
|
protected javax.swing.JMenu |
sizeSubmenu
|
protected AbstractSwingField |
swingField
|
| Constructor Summary | |
|---|---|
protected |
FieldWidget(SectionWidget sw,
AbstractSwingField asf)
Constructor. |
|
FieldWidget(SectionWidget sw,
Field field)
Constructor. |
| Method Summary | |
|---|---|
protected int |
actionFromPosition(java.awt.event.MouseEvent e)
Given a mouse event, returns the ACTION_* constant
associated with the mouse position within the field. |
void |
actionPerformed(java.awt.event.ActionEvent e)
Performs some action based on the action command string (the menu item text). |
protected void |
addCustomPopupItems()
This hook lets subclasses customize the popup menu. |
void |
align(int which,
Field prototype)
Align this field in relation to prototype. |
protected void |
buildPopupMenu()
Builds the popup menu. |
protected void |
cursorForPosition(java.awt.event.MouseEvent e)
If this field is selected, sets the cursor based on the current mouse position in the widget. |
protected void |
delete()
Asks the window delete this field and all selected fields. |
void |
doDelete()
Deletes this field from its section. |
(package private) void |
doDrag(int action,
java.awt.Point mouseScreenPos)
Performs a drag or a stretch. |
(package private) void |
doSelect(boolean makeSelected)
Performs whatever is necessary to select or deselct self. |
void |
doSetVisibility(boolean newVisibility)
Sets the visiblity of this field. |
void |
dragEnter(java.awt.dnd.DropTargetDragEvent e)
|
void |
dragExit(java.awt.dnd.DropTargetEvent e)
|
void |
dragOver(java.awt.dnd.DropTargetDragEvent e)
|
void |
drop(java.awt.dnd.DropTargetDropEvent e)
Handles drop of a dragged field. |
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent e)
|
protected void |
enableMenuItems()
Enables or disables popup menu items based on field and window state. |
protected void |
finalize()
|
(package private) static FieldWidget |
findFieldWidgetOwning(java.lang.Object c)
Returns the field widget that owns a particular visual component. |
(package private) java.awt.Color |
getColor()
|
javax.swing.JComponent |
getComponent()
|
Field |
getField()
|
protected java.lang.String |
getPopupNameText()
Returns string to use for popup menu's first item, the (disabled) name of this field. |
PreMoveInfo |
getPreMoveInfo()
Returns the information we saved before starting to move this widget. |
SectionWidget |
getSectionWidget()
Returns the section widget containing this field widget. |
(package private) boolean |
isSelected()
Returns true if the field is selected. |
void |
keyPressed(java.awt.event.KeyEvent ke)
|
void |
keyReleased(java.awt.event.KeyEvent ke)
|
void |
keyTyped(java.awt.event.KeyEvent ke)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
If the user is placing a new text field, pass it on to the section widget; else do nothing. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Asks section to drag (move, resize) all selected widgets together. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Changes cursor if this widget is selected. |
void |
mouseExited(java.awt.event.MouseEvent e)
Changes cursor if this widget is selected. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Changes cursor if this widget is selected. |
void |
mousePressed(java.awt.event.MouseEvent e)
When the mouse is pressed, do the Right Thing(tm). |
protected boolean |
mousePressReleaseCommon(java.awt.event.MouseEvent e)
Performs checks and behaviors common to both mouse presses and mouse release events. |
void |
mouseReleased(java.awt.event.MouseEvent e)
When the mouse is released and we have been dragging this field, drop this one and all others that are being dragged. |
void |
moveToSection(SectionWidget sw)
Moves both field view and model to a new section. |
void |
pickUp(java.awt.Point mouseScreenPos)
Prepares for movement by remembering where we are now and removing ourself from the section view widget (but not the section model). |
void |
putDown(SectionWidget sw)
Place this field into a section widget. |
protected void |
resetCursor()
Resets the cursor to its default. |
(package private) void |
select(boolean deselectOthers)
Selects this field. |
protected void |
setVisibilityLook()
Sets the look of the field based on the current visiblity flag value. |
protected void |
showPopupMenu(java.awt.event.MouseEvent e)
Displays popup menu, after enabling/disabling the appropriate items. |
void |
size(int which,
Field prototype)
Resize this field in relation to prototype. |
(package private) void |
snapBack()
Move back to original location in original section widget. |
void |
startStretching(java.awt.Point mouseScreenPos)
Prepares for stretching by creating a PreStretchInfo. |
void |
stopStretching()
Stop stretching. |
(package private) void |
toggleVisibility()
Toggles the visiblity of this field and all selected fields. |
java.lang.String |
toString()
|
void |
update(java.util.Observable obj,
java.lang.Object arg)
|
boolean |
usesFormat()
Returns true if this field can be formatted. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final int GRAB_EDGE_WIDTH
protected static final int ACTION_INACTION
protected static final int ACTION_MOVE
protected static final int ACTION_STRETCH_LEFT
protected static final int ACTION_STRETCH_RIGHT
protected static final int ACTION_STRETCH_TOP
protected static final int ACTION_STRETCH_BOTTOM
protected static final int ACTION_POPPING_UP_MENU
protected static final int MIN_SIZE
protected static final java.awt.Font POPUP_FONT
protected static java.util.HashMap componentMap
protected AbstractSwingField swingField
protected SectionWidget sectionWidget
protected int action
protected boolean actionStartedYet
protected boolean selected
protected boolean mouseChangedSelectedState
protected PreMoveInfo preMoveInfo
protected PreStretchInfo preStretchInfo
protected javax.swing.JPopupMenu popup
protected javax.swing.JMenu alignSubmenu
protected javax.swing.JMenu sizeSubmenu
protected javax.swing.JMenuItem nameItem
protected javax.swing.JMenuItem showOrHide
protected javax.swing.JMenuItem formatMenuItem
protected javax.swing.JMenuItem aggregatesMenuItem
| Constructor Detail |
|---|
public FieldWidget(SectionWidget sw,
Field field)
sw - section widget in which the field's new widget will residefield - a report field
protected FieldWidget(SectionWidget sw,
AbstractSwingField asf)
sw - section widget in which the field's new widget will resideasf - an abstract swing field| Method Detail |
|---|
static FieldWidget findFieldWidgetOwning(java.lang.Object c)
nullprotected void buildPopupMenu()
protected void addCustomPopupItems()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
public void update(java.util.Observable obj,
java.lang.Object arg)
update in interface java.util.Observerpublic boolean usesFormat()
true if this field can be formatted.
true if this field can be formattedprotected java.lang.String getPopupNameText()
public SectionWidget getSectionWidget()
boolean isSelected()
true if the field is selected.
true if the field is selected
public void align(int which,
Field prototype)
which - one of the Designer.ALIGN_* constantsprototype - the field to which this one should be aligned
public void size(int which,
Field prototype)
which - one of the Designer.SIZE_SAME_* constantsprototype - the field from which this one should take sizesvoid select(boolean deselectOthers)
true, do so. Eventually
doSelect(boolean) will be called.
deselectOthers - if true, do sovoid doSelect(boolean makeSelected)
Designer.select(jimm.datavision.gui.FieldWidget, boolean, boolean).
makeSelected - new selection statepublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - mouseventpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - mouse eventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - mouse eventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - mouse eventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - mouse eventpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - mouse eventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - mouse eventprotected boolean mousePressReleaseCommon(java.awt.event.MouseEvent e)
true if the event was handled by
this method and should be ignored by the caller.
e - the mouse event
true if the event was handled by this method and
should be ignored by the callerpublic PreMoveInfo getPreMoveInfo()
public void pickUp(java.awt.Point mouseScreenPos)
public void putDown(SectionWidget sw)
void snapBack()
public void startStretching(java.awt.Point mouseScreenPos)
PreStretchInfo.
mouseScreenPos - the location of the mouse in screen coordinatespublic void stopStretching()
protected void showPopupMenu(java.awt.event.MouseEvent e)
protected void enableMenuItems()
protected int actionFromPosition(java.awt.event.MouseEvent e)
ACTION_* constant
associated with the mouse position within the field.
protected void cursorForPosition(java.awt.event.MouseEvent e)
e - a mouse eventprotected void resetCursor()
void doDrag(int action,
java.awt.Point mouseScreenPos)
Designer.dragSelectedWidgets(int, java.awt.Point).
action - a ACTION_* constantmouseScreenPos - the location of the mouse in screen coordinatesDesigner.dragSelectedWidgets(int, java.awt.Point)protected void delete()
public void doDelete()
public void moveToSection(SectionWidget sw)
sw - a section widgetpublic void drop(java.awt.dnd.DropTargetDropEvent e)
drop in interface java.awt.dnd.DropTargetListenere - drop eventSectionFieldPanel.drop(java.awt.dnd.DropTargetDropEvent)public void dragEnter(java.awt.dnd.DropTargetDragEvent e)
dragEnter in interface java.awt.dnd.DropTargetListenerpublic void dragExit(java.awt.dnd.DropTargetEvent e)
dragExit in interface java.awt.dnd.DropTargetListenerpublic void dragOver(java.awt.dnd.DropTargetDragEvent e)
dragOver in interface java.awt.dnd.DropTargetListenerpublic void dropActionChanged(java.awt.dnd.DropTargetDragEvent e)
dropActionChanged in interface java.awt.dnd.DropTargetListenerpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic java.lang.String toString()
toString in class java.lang.Objectvoid toggleVisibility()
public void doSetVisibility(boolean newVisibility)
toggleVisibility.
protected void setVisibilityLook()
AbstractSwingField does all the work.
We just ask our swingField to re-format itself.
java.awt.Color getColor()
public Field getField()
public javax.swing.JComponent getComponent()
public void keyPressed(java.awt.event.KeyEvent ke)
keyPressed in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent ke)
keyTyped in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent ke)
keyReleased in interface java.awt.event.KeyListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||