Java Doc for FieldWidget.java in  » Report » datavision-1.1.0 » jimm » datavision » gui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Report » datavision 1.1.0 » jimm.datavision.gui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jimm.datavision.gui.FieldWidget

All known Subclasses:   jimm.datavision.gui.EditWinWidget,  jimm.datavision.gui.ImageFieldWidget,  jimm.datavision.gui.TextFieldWidget,
FieldWidget
public class FieldWidget implements MouseInputListener,DropTargetListener,ActionListener,KeyListener,Observer(Code)
A field widget is the visual representation of a text-based report field.
author:
   Jim Menard, jimm@io.com


Field Summary
final protected static  intACTION_INACTION
    
final protected static  intACTION_MOVE
    
final protected static  intACTION_POPPING_UP_MENU
    
final protected static  intACTION_STRETCH_BOTTOM
    
final protected static  intACTION_STRETCH_LEFT
    
final protected static  intACTION_STRETCH_RIGHT
    
final protected static  intACTION_STRETCH_TOP
    
final protected static  intGRAB_EDGE_WIDTH
    
final protected static  intMIN_SIZE
     Minimum field with and height.
final protected static  FontPOPUP_FONT
    
protected  intaction
    
protected  booleanactionStartedYet
    
protected  JMenuItemaggregatesMenuItem
    
protected  JMenualignSubmenu
    
protected static  HashMapcomponentMap
    
protected  JMenuItemformatMenuItem
    
protected  booleanmouseChangedSelectedState
    
protected  JMenuItemnameItem
    
protected  JPopupMenupopup
    
protected  PreMoveInfopreMoveInfo
    
protected  PreStretchInfopreStretchInfo
    
protected  SectionWidgetsectionWidget
    
protected  booleanselected
    
protected  JMenuItemshowOrHide
    
protected  JMenusizeSubmenu
    
protected  AbstractSwingFieldswingField
    

Constructor Summary
public  FieldWidget(SectionWidget sw, Field field)
     Constructor.
protected  FieldWidget(SectionWidget sw, AbstractSwingField asf)
     Constructor.

Method Summary
protected  intactionFromPosition(MouseEvent e)
     Given a mouse event, returns the ACTION_* constant associated with the mouse position within the field.
public  voidactionPerformed(ActionEvent e)
     Performs some action based on the action command string (the menu item text).
protected  voidaddCustomPopupItems()
     This hook lets subclasses customize the popup menu.
public  voidalign(int which, Field prototype)
     Align this field in relation to prototype.
protected  voidbuildPopupMenu()
     Builds the popup menu.
protected  voidcursorForPosition(MouseEvent e)
     If this field is selected, sets the cursor based on the current mouse position in the widget.
protected  voiddelete()
     Asks the window delete this field and all selected fields.
public  voiddoDelete()
     Deletes this field from its section.
 voiddoDrag(int action, java.awt.Point mouseScreenPos)
     Performs a drag or a stretch.
 voiddoSelect(boolean makeSelected)
     Performs whatever is necessary to select or deselct self.
public  voiddoSetVisibility(boolean newVisibility)
     Sets the visiblity of this field.
public  voiddragEnter(DropTargetDragEvent e)
    
public  voiddragExit(DropTargetEvent e)
    
public  voiddragOver(DropTargetDragEvent e)
    
public  voiddrop(DropTargetDropEvent e)
     Handles drop of a dragged field.
public  voiddropActionChanged(DropTargetDragEvent e)
    
protected  voidenableMenuItems()
     Enables or disables popup menu items based on field and window state.
protected  voidfinalize()
    
static  FieldWidgetfindFieldWidgetOwning(Object c)
     Returns the field widget that owns a particular visual component.
 ColorgetColor()
    
public  JComponentgetComponent()
    
public  FieldgetField()
    
protected  StringgetPopupNameText()
     Returns string to use for popup menu's first item, the (disabled) name of this field.
public  PreMoveInfogetPreMoveInfo()
     Returns the information we saved before starting to move this widget.
public  SectionWidgetgetSectionWidget()
     Returns the section widget containing this field widget.
 booleanisSelected()
     Returns true if the field is selected.
public  voidkeyPressed(KeyEvent ke)
    
public  voidkeyReleased(KeyEvent ke)
    
public  voidkeyTyped(KeyEvent ke)
    
public  voidmouseClicked(MouseEvent e)
     If the user is placing a new text field, pass it on to the section widget; else do nothing.
public  voidmouseDragged(MouseEvent e)
     Asks section to drag (move, resize) all selected widgets together.
public  voidmouseEntered(MouseEvent e)
     Changes cursor if this widget is selected.
public  voidmouseExited(MouseEvent e)
     Changes cursor if this widget is selected.
public  voidmouseMoved(MouseEvent e)
     Changes cursor if this widget is selected.
protected  booleanmousePressReleaseCommon(MouseEvent e)
     Performs checks and behaviors common to both mouse presses and mouse release events.
public  voidmousePressed(MouseEvent e)
     When the mouse is pressed, do the Right Thing(tm).
public  voidmouseReleased(MouseEvent e)
     When the mouse is released and we have been dragging this field, drop this one and all others that are being dragged.
public  voidmoveToSection(SectionWidget sw)
     Moves both field view and model to a new section.
public  voidpickUp(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).
public  voidputDown(SectionWidget sw)
     Place this field into a section widget.
protected  voidresetCursor()
     Resets the cursor to its default.
 voidselect(boolean deselectOthers)
     Selects this field.
protected  voidsetVisibilityLook()
     Sets the look of the field based on the current visiblity flag value.
protected  voidshowPopupMenu(MouseEvent e)
     Displays popup menu, after enabling/disabling the appropriate items.
public  voidsize(int which, Field prototype)
     Resize this field in relation to prototype.
 voidsnapBack()
     Move back to original location in original section widget.
public  voidstartStretching(java.awt.Point mouseScreenPos)
     Prepares for stretching by creating a PreStretchInfo.
public  voidstopStretching()
     Stop stretching.
public  StringtoString()
    
 voidtoggleVisibility()
     Toggles the visiblity of this field and all selected fields.
public  voidupdate(Observable obj, Object arg)
    
public  booleanusesFormat()
     Returns true if this field can be formatted.

Field Detail
ACTION_INACTION
final protected static int ACTION_INACTION(Code)



ACTION_MOVE
final protected static int ACTION_MOVE(Code)



ACTION_POPPING_UP_MENU
final protected static int ACTION_POPPING_UP_MENU(Code)



ACTION_STRETCH_BOTTOM
final protected static int ACTION_STRETCH_BOTTOM(Code)



ACTION_STRETCH_LEFT
final protected static int ACTION_STRETCH_LEFT(Code)



ACTION_STRETCH_RIGHT
final protected static int ACTION_STRETCH_RIGHT(Code)



ACTION_STRETCH_TOP
final protected static int ACTION_STRETCH_TOP(Code)



GRAB_EDGE_WIDTH
final protected static int GRAB_EDGE_WIDTH(Code)



MIN_SIZE
final protected static int MIN_SIZE(Code)
Minimum field with and height.



POPUP_FONT
final protected static Font POPUP_FONT(Code)



action
protected int action(Code)



actionStartedYet
protected boolean actionStartedYet(Code)



aggregatesMenuItem
protected JMenuItem aggregatesMenuItem(Code)



alignSubmenu
protected JMenu alignSubmenu(Code)



componentMap
protected static HashMap componentMap(Code)



formatMenuItem
protected JMenuItem formatMenuItem(Code)



mouseChangedSelectedState
protected boolean mouseChangedSelectedState(Code)



nameItem
protected JMenuItem nameItem(Code)



popup
protected JPopupMenu popup(Code)



preMoveInfo
protected PreMoveInfo preMoveInfo(Code)



preStretchInfo
protected PreStretchInfo preStretchInfo(Code)



sectionWidget
protected SectionWidget sectionWidget(Code)



selected
protected boolean selected(Code)



showOrHide
protected JMenuItem showOrHide(Code)



sizeSubmenu
protected JMenu sizeSubmenu(Code)



swingField
protected AbstractSwingField swingField(Code)




Constructor Detail
FieldWidget
public FieldWidget(SectionWidget sw, Field field)(Code)
Constructor.
Parameters:
  sw - section widget in which the field's new widget will reside
Parameters:
  field - a report field



FieldWidget
protected FieldWidget(SectionWidget sw, AbstractSwingField asf)(Code)
Constructor.
Parameters:
  sw - section widget in which the field's new widget will reside
Parameters:
  asf - an abstract swing field




Method Detail
actionFromPosition
protected int actionFromPosition(MouseEvent e)(Code)
Given a mouse event, returns the ACTION_* constant associated with the mouse position within the field.



actionPerformed
public void actionPerformed(ActionEvent e)(Code)
Performs some action based on the action command string (the menu item text).



addCustomPopupItems
protected void addCustomPopupItems()(Code)
This hook lets subclasses customize the popup menu. By default, nothing happens.



align
public void align(int which, Field prototype)(Code)
Align this field in relation to prototype.
Parameters:
  which - one of the Designer.ALIGN_* constants
Parameters:
  prototype - the field to which this one should be aligned



buildPopupMenu
protected void buildPopupMenu()(Code)
Builds the popup menu.



cursorForPosition
protected void cursorForPosition(MouseEvent e)(Code)
If this field is selected, sets the cursor based on the current mouse position in the widget. If the field is unselected, resets the cursor.
Parameters:
  e - a mouse event



delete
protected void delete()(Code)
Asks the window delete this field and all selected fields.



doDelete
public void doDelete()(Code)
Deletes this field from its section. Deletes the report field from the report section (the model) and the field widget from the parent widget (the view/controller).



doDrag
void doDrag(int action, java.awt.Point mouseScreenPos)(Code)
Performs a drag or a stretch. Called from Designer.dragSelectedWidgets .
Parameters:
  action - a ACTION_* constant
Parameters:
  mouseScreenPos - the location of the mouse in screen coordinates
See Also:   Designer.dragSelectedWidgets



doSelect
void doSelect(boolean makeSelected)(Code)
Performs whatever is necessary to select or deselct self. Called by Designer.select .
Parameters:
  makeSelected - new selection state



doSetVisibility
public void doSetVisibility(boolean newVisibility)(Code)
Sets the visiblity of this field. Called directly and/or indirectly from toggleVisibility.



dragEnter
public void dragEnter(DropTargetDragEvent e)(Code)



dragExit
public void dragExit(DropTargetEvent e)(Code)



dragOver
public void dragOver(DropTargetDragEvent e)(Code)



drop
public void drop(DropTargetDropEvent e)(Code)
Handles drop of a dragged field. Passes request on to parent view.
Parameters:
  e - drop event
See Also:   SectionFieldPanel.drop



dropActionChanged
public void dropActionChanged(DropTargetDragEvent e)(Code)



enableMenuItems
protected void enableMenuItems()(Code)
Enables or disables popup menu items based on field and window state.



finalize
protected void finalize() throws Throwable(Code)



findFieldWidgetOwning
static FieldWidget findFieldWidgetOwning(Object c)(Code)
Returns the field widget that owns a particular visual component. a field widget or null



getColor
Color getColor()(Code)



getComponent
public JComponent getComponent()(Code)



getField
public Field getField()(Code)



getPopupNameText
protected String getPopupNameText()(Code)
Returns string to use for popup menu's first item, the (disabled) name of this field.



getPreMoveInfo
public PreMoveInfo getPreMoveInfo()(Code)
Returns the information we saved before starting to move this widget. an object containing the information we saved before startingto move this widget



getSectionWidget
public SectionWidget getSectionWidget()(Code)
Returns the section widget containing this field widget. the section widget containing this field widget



isSelected
boolean isSelected()(Code)
Returns true if the field is selected. true if the field is selected



keyPressed
public void keyPressed(KeyEvent ke)(Code)



keyReleased
public void keyReleased(KeyEvent ke)(Code)



keyTyped
public void keyTyped(KeyEvent ke)(Code)



mouseClicked
public void mouseClicked(MouseEvent e)(Code)
If the user is placing a new text field, pass it on to the section widget; else do nothing.
Parameters:
  e - mousevent



mouseDragged
public void mouseDragged(MouseEvent e)(Code)
Asks section to drag (move, resize) all selected widgets together. (The section, in turn, asks the window to do the same.)
Parameters:
  e - mouse event



mouseEntered
public void mouseEntered(MouseEvent e)(Code)
Changes cursor if this widget is selected.
Parameters:
  e - mouse event



mouseExited
public void mouseExited(MouseEvent e)(Code)
Changes cursor if this widget is selected.
Parameters:
  e - mouse event



mouseMoved
public void mouseMoved(MouseEvent e)(Code)
Changes cursor if this widget is selected.
Parameters:
  e - mouse event



mousePressReleaseCommon
protected boolean mousePressReleaseCommon(MouseEvent e)(Code)
Performs checks and behaviors common to both mouse presses and mouse release events. Returns true if the event was handled by this method and should be ignored by the caller.
Parameters:
  e - the mouse event true if the event was handled by this method andshould be ignored by the caller



mousePressed
public void mousePressed(MouseEvent e)(Code)
When the mouse is pressed, do the Right Thing(tm). Handles popup menu, selecting, shift-selecting, and prepping for movement.
Parameters:
  e - mouse event



mouseReleased
public void mouseReleased(MouseEvent e)(Code)
When the mouse is released and we have been dragging this field, drop this one and all others that are being dragged.
Parameters:
  e - mouse event



moveToSection
public void moveToSection(SectionWidget sw)(Code)
Moves both field view and model to a new section. Technically, moves model to a new section and adds view to section widget.
Parameters:
  sw - a section widget



pickUp
public void pickUp(java.awt.Point mouseScreenPos)(Code)
Prepares for movement by remembering where we are now and removing ourself from the section view widget (but not the section model).



putDown
public void putDown(SectionWidget sw)(Code)
Place this field into a section widget. Our bounds rectangle is in window coordinates; translate to section coordinates.



resetCursor
protected void resetCursor()(Code)
Resets the cursor to its default.



select
void select(boolean deselectOthers)(Code)
Selects this field. If the shift key is down (we don't want to deselect other fields), toggles the selection state instead. If deselectOthers is true, do so. Eventually FieldWidget.doSelect will be called.
Parameters:
  deselectOthers - if true, do so



setVisibilityLook
protected void setVisibilityLook()(Code)
Sets the look of the field based on the current visiblity flag value. The jimm.datavision.layout.swing.AbstractSwingField does all the work. We just ask our swingField to re-format itself.



showPopupMenu
protected void showPopupMenu(MouseEvent e)(Code)
Displays popup menu, after enabling/disabling the appropriate items.



size
public void size(int which, Field prototype)(Code)
Resize this field in relation to prototype.
Parameters:
  which - one of the Designer.SIZE_SAME_* constants
Parameters:
  prototype - the field from which this one should take sizes



snapBack
void snapBack()(Code)
Move back to original location in original section widget.



startStretching
public void startStretching(java.awt.Point mouseScreenPos)(Code)
Prepares for stretching by creating a PreStretchInfo.
Parameters:
  mouseScreenPos - the location of the mouse in screen coordinates



stopStretching
public void stopStretching()(Code)
Stop stretching.



toString
public String toString()(Code)



toggleVisibility
void toggleVisibility()(Code)
Toggles the visiblity of this field and all selected fields.



update
public void update(Observable obj, Object arg)(Code)



usesFormat
public boolean usesFormat()(Code)
Returns true if this field can be formatted. true if this field can be formatted



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.