Java Doc for JGraphEditorDiagramPane.java in  » Graphic-Library » jgraphpad » com » jgraph » editor » factory » 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 » Graphic Library » jgraphpad » com.jgraph.editor.factory 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.swing.JScrollPane
   com.jgraph.editor.factory.JGraphEditorDiagramPane

JGraphEditorDiagramPane
public class JGraphEditorDiagramPane extends JScrollPane implements Printable(Code)
Wrapper panel for a diagram/JGraph-pair that implements automatic sizing, backgrounds, printing and undo support. When wrapped in a scrollpane this panel adds rulers to the enclosing scrollpane. Furthermore, it automatically sets the minimum size and scale of the graph based on its settings.

Inner Class :public class Viewport extends JViewport

Field Summary
final public static  intAUTOSCALE_POLICY_NONE
     Defines the no autoscaling policy.
final public static  intAUTOSCALE_POLICY_PAGE
     Defines the page autoscaling policy.
final public static  intAUTOSCALE_POLICY_PAGEWIDTH
     Defines the pagewidth autoscaling policy.
final public static  intAUTOSCALE_POLICY_WINDOW
     Defines the window-size autoscaling policy.
final public static  intDEFAULT_HISTORYSIZE
     Specifies the size of the undo history.
final public static  booleanDEFAULT_ISMETRIC
     Specifies the default unit system.
final public static  doubleDEFAULT_PAGESCALE
     Specifies the default page scale.
public static  StringPROPERTY_METRICPROPERTY_PAGEVISIBLEPROPERTY_BACKGROUNDIMAGEPROPERTY_RULERSVISIBLEPROPERTY_PAGEFORMATPROPERTY_AUTOSCALEPOLICYPROPERTY_PAGESCALE
     Bound property names for the respective properties.
protected  intautoScalePolicy
     Specified the autoscaling policy.
protected  PropertyChangeListenerautoScaleResetListener
     Holds the autoscale reset listener to be used with the graph.
protected  ImageIconbackgroundImage
     Holds the background image.
protected  JGraphEditorDiagramdiagram
     References the diagram this pane represents.
protected  JGraphgraph
     References the inner graph.
protected  booleanisMetric
     Specifies if the rulers should use metric units.
protected  booleanisPageVisible
     Specifies if the background page is visible.
protected  booleanisRulersVisible
     Specifies if the rules should be visible.
protected  PageFormatpageFormat
     Background page format.
protected  doublepageScale
     Defines the scaling for the background page metrics.
protected transient  GraphUndoManagerundoManager
     Holds the undo manager for the graph.
protected  JGraphEditorRulerverticalRulerhorizontalRuler
     Holds the rulers to be used in a parent scrollpane.

Constructor Summary
public  JGraphEditorDiagramPane(JGraphEditorDiagram diagram, JGraph graph)
     Constructs a new graph pane for the specified diagram and graph.

Method Summary
protected  doublecomputePageScale()
     Computes the scale for the page autoscale policy.
protected  doublecomputePageWidthScale(int border)
     Computes the scale for the pagewidth autoscale policy.
Parameters:
  border - The border to use.
protected  doublecomputeWindowScale(int border)
     Computes the scale for the window autoscale policy.
Parameters:
  border - The border to use.
public  PropertyChangeListenercreateAutoScaleResetListener()
     Hook for subclassers to create the autoscale reset listener.
protected  voidcreateRulers()
     Hook for subclassers to create the rulers.
protected  JViewportcreateViewport()
     Hook for subclassers to create the viewport.
public  intgetAutoScalePolicy()
     Returns the autoscale policy.
public  ImageIcongetBackgroundImage()
     Returns the background image.
public  JGraphEditorDiagramgetDiagram()
     Returns the diagram.
public  JGraphgetGraph()
     Returns the inner graph.
public  GraphUndoManagergetGraphUndoManager()
     Returns the graph undo manager.
public  JGraphEditorRulergetHorizontalRuler()
     Returns the horizontal ruler.
public  BufferedImagegetImage(Color bg, int inset)
     Returns a BufferedImage for the graph using inset as an empty border around the cells of the graph.
public  PageFormatgetPageFormat()
     Returns the page format of the background page.
public  doublegetPageScale()
     Returns the scale of the page metrics.
public static  JGraphEditorDiagramPanegetParentDiagramPane(Component component)
     Returns the parent diagram pane of the specified component, or the component itself if it is a editor diagram pane.
public  JGraphEditorRulergetVerticalRuler()
     Returns the vertical ruler.
public  booleanisMetric()
     Returns true if the rulers use metric units.
public  booleanisPageVisible()
     Returns true if the background page is visible.
public  booleanisRulersVisible()
     Returns true if the rulers are to be displayed.
public  intprint(Graphics g, PageFormat printFormat, int page)
     Prints the specified page on the specified graphics using pageForm for the page format.
public  voidsetAutoScalePolicy(int autoScalePolicy)
     Sets the autoscale policy.
public  voidsetBackgroundImage(ImageIcon backgroundImage)
     Sets the background image.
public  voidsetGraphUndoManager(GraphUndoManager undoManager)
     Sets the graph undo manager.
public  voidsetMetric(boolean isMetric)
     Specifies if the rulers should use metric units.
public  voidsetPageFormat(PageFormat pageFormat)
     Sets the page format of the background page.Fires a property change event for JGraphEditorDiagramPane.PROPERTY_PAGEFORMAT .
public  voidsetPageScale(double pageScale)
     Sets the scale of the page metrics.Fires a property change event for JGraphEditorDiagramPane.PROPERTY_PAGESCALE .
public  voidsetPageVisible(boolean isPageVisible)
     Sets if the background page should be visible.Fires a property change event for JGraphEditorDiagramPane.PROPERTY_PAGEVISIBLE .
public  voidsetRulersVisible(boolean isRulersVisible)
     Sets if the rulers are to be displayed.
protected  voidupdateMinimumSize()
     Updates the minimum size of the graph according to the current state of the background page: if the page is not visible then the minimum size is set to null, otherwise the minimum size is set to the smallest area of pages containing the graph.
protected  voidupdateScale()
     Updates the scale based on the autoscale policy.

Field Detail
AUTOSCALE_POLICY_NONE
final public static int AUTOSCALE_POLICY_NONE(Code)
Defines the no autoscaling policy.



AUTOSCALE_POLICY_PAGE
final public static int AUTOSCALE_POLICY_PAGE(Code)
Defines the page autoscaling policy.



AUTOSCALE_POLICY_PAGEWIDTH
final public static int AUTOSCALE_POLICY_PAGEWIDTH(Code)
Defines the pagewidth autoscaling policy.



AUTOSCALE_POLICY_WINDOW
final public static int AUTOSCALE_POLICY_WINDOW(Code)
Defines the window-size autoscaling policy.



DEFAULT_HISTORYSIZE
final public static int DEFAULT_HISTORYSIZE(Code)
Specifies the size of the undo history. Default is 100.



DEFAULT_ISMETRIC
final public static boolean DEFAULT_ISMETRIC(Code)
Specifies the default unit system. Default is metric.



DEFAULT_PAGESCALE
final public static double DEFAULT_PAGESCALE(Code)
Specifies the default page scale. Default is 1.5



PROPERTY_METRICPROPERTY_PAGEVISIBLEPROPERTY_BACKGROUNDIMAGEPROPERTY_RULERSVISIBLEPROPERTY_PAGEFORMATPROPERTY_AUTOSCALEPOLICYPROPERTY_PAGESCALE
public static String PROPERTY_METRICPROPERTY_PAGEVISIBLEPROPERTY_BACKGROUNDIMAGEPROPERTY_RULERSVISIBLEPROPERTY_PAGEFORMATPROPERTY_AUTOSCALEPOLICYPROPERTY_PAGESCALE(Code)
Bound property names for the respective properties.



autoScalePolicy
protected int autoScalePolicy(Code)
Specified the autoscaling policy. Default is JGraphEditorDiagramPane.AUTOSCALE_POLICY_NONE .



autoScaleResetListener
protected PropertyChangeListener autoScaleResetListener(Code)
Holds the autoscale reset listener to be used with the graph. This listener is used to reset the autoscale policy to none if the scale of the graph is changed manually, ie. not by means of automatic scaling.



backgroundImage
protected ImageIcon backgroundImage(Code)
Holds the background image.



diagram
protected JGraphEditorDiagram diagram(Code)
References the diagram this pane represents.



graph
protected JGraph graph(Code)
References the inner graph.



isMetric
protected boolean isMetric(Code)
Specifies if the rulers should use metric units. Default is true.



isPageVisible
protected boolean isPageVisible(Code)
Specifies if the background page is visible. Default is true.



isRulersVisible
protected boolean isRulersVisible(Code)
Specifies if the rules should be visible. Default is true.



pageFormat
protected PageFormat pageFormat(Code)
Background page format.



pageScale
protected double pageScale(Code)
Defines the scaling for the background page metrics. Default is JGraphEditorDiagramPane.DEFAULT_PAGESCALE .



undoManager
protected transient GraphUndoManager undoManager(Code)
Holds the undo manager for the graph.



verticalRulerhorizontalRuler
protected JGraphEditorRuler verticalRulerhorizontalRuler(Code)
Holds the rulers to be used in a parent scrollpane.




Constructor Detail
JGraphEditorDiagramPane
public JGraphEditorDiagramPane(JGraphEditorDiagram diagram, JGraph graph)(Code)
Constructs a new graph pane for the specified diagram and graph.




Method Detail
computePageScale
protected double computePageScale()(Code)
Computes the scale for the page autoscale policy. Returns the scale to use for the graph.



computePageWidthScale
protected double computePageWidthScale(int border)(Code)
Computes the scale for the pagewidth autoscale policy.
Parameters:
  border - The border to use. Returns the scale to use for the graph.



computeWindowScale
protected double computeWindowScale(int border)(Code)
Computes the scale for the window autoscale policy.
Parameters:
  border - The border to use. Returns the scale to use for the graph.



createAutoScaleResetListener
public PropertyChangeListener createAutoScaleResetListener()(Code)
Hook for subclassers to create the autoscale reset listener. Returns a new autoscale reset listener.



createRulers
protected void createRulers()(Code)
Hook for subclassers to create the rulers. This implementation sets the JGraphEditorDiagramPane.horizontalRuler and JGraphEditorDiagramPane.verticalRuler .



createViewport
protected JViewport createViewport()(Code)
Hook for subclassers to create the viewport. Returns a new viewport to be used in the panel.



getAutoScalePolicy
public int getAutoScalePolicy()(Code)
Returns the autoscale policy. Returns the autoScalePolicy.



getBackgroundImage
public ImageIcon getBackgroundImage()(Code)
Returns the background image. Returns the backgroundImage.



getDiagram
public JGraphEditorDiagram getDiagram()(Code)
Returns the diagram. Returns the cacheNode.



getGraph
public JGraph getGraph()(Code)
Returns the inner graph. Returns the graph.



getGraphUndoManager
public GraphUndoManager getGraphUndoManager()(Code)
Returns the graph undo manager. Returns the graphUndoManager.



getHorizontalRuler
public JGraphEditorRuler getHorizontalRuler()(Code)
Returns the horizontal ruler. Returns the horizontalRuler.



getImage
public BufferedImage getImage(Color bg, int inset)(Code)
Returns a BufferedImage for the graph using inset as an empty border around the cells of the graph. If bg is null then a transparent background is applied to the image, else the background is filled with the bg color. Therefore, one should only use a null background if the fileformat support transparency, eg. GIF and PNG. For JPG, you can use Color.WHITE for example. This implementation also takes into account potential background images. Returns an image of the graph.



getPageFormat
public PageFormat getPageFormat()(Code)
Returns the page format of the background page. Returns the pageFormat.



getPageScale
public double getPageScale()(Code)
Returns the scale of the page metrics. Returns the pageScale.



getParentDiagramPane
public static JGraphEditorDiagramPane getParentDiagramPane(Component component)(Code)
Returns the parent diagram pane of the specified component, or the component itself if it is a editor diagram pane. Returns the parent editor diagram pane of component.



getVerticalRuler
public JGraphEditorRuler getVerticalRuler()(Code)
Returns the vertical ruler. Returns the verticalRuler.



isMetric
public boolean isMetric()(Code)
Returns true if the rulers use metric units. Returns the isMetric.



isPageVisible
public boolean isPageVisible()(Code)
Returns true if the background page is visible. Returns the isPageVisible.



isRulersVisible
public boolean isRulersVisible()(Code)
Returns true if the rulers are to be displayed. Returns the isRulersVisible.



print
public int print(Graphics g, PageFormat printFormat, int page)(Code)
Prints the specified page on the specified graphics using pageForm for the page format.
Parameters:
  g - The graphics to paint the graph on.
Parameters:
  printFormat - The page format to use for printing.
Parameters:
  page - The page to print Returns Printable.PAGE_EXISTS orPrintable.NO_SUCH_PAGE.



setAutoScalePolicy
public void setAutoScalePolicy(int autoScalePolicy)(Code)
Sets the autoscale policy. Possible values is one of: JGraphEditorDiagramPane.AUTOSCALE_POLICY_NONE , JGraphEditorDiagramPane.AUTOSCALE_POLICY_PAGE , JGraphEditorDiagramPane.AUTOSCALE_POLICY_PAGEWIDTH or JGraphEditorDiagramPane.AUTOSCALE_POLICY_WINDOW . Fires a property change event for JGraphEditorDiagramPane.PROPERTY_AUTOSCALEPOLICY .
Parameters:
  autoScalePolicy - The autoScalePolicy to set.



setBackgroundImage
public void setBackgroundImage(ImageIcon backgroundImage)(Code)
Sets the background image. Fires a property change event for JGraphEditorDiagramPane.PROPERTY_BACKGROUNDIMAGE .
Parameters:
  backgroundImage - The backgroundImage to set.



setGraphUndoManager
public void setGraphUndoManager(GraphUndoManager undoManager)(Code)
Sets the graph undo manager.
Parameters:
  undoManager - The graphUndoManager to set.



setMetric
public void setMetric(boolean isMetric)(Code)
Specifies if the rulers should use metric units. Fires a property change event for JGraphEditorDiagramPane.PROPERTY_METRIC .
Parameters:
  isMetric - The isMetric to set.



setPageFormat
public void setPageFormat(PageFormat pageFormat)(Code)
Sets the page format of the background page.Fires a property change event for JGraphEditorDiagramPane.PROPERTY_PAGEFORMAT .
Parameters:
  pageFormat - The pageFormat to set.



setPageScale
public void setPageScale(double pageScale)(Code)
Sets the scale of the page metrics.Fires a property change event for JGraphEditorDiagramPane.PROPERTY_PAGESCALE .
Parameters:
  pageScale - The pageScale to set.



setPageVisible
public void setPageVisible(boolean isPageVisible)(Code)
Sets if the background page should be visible.Fires a property change event for JGraphEditorDiagramPane.PROPERTY_PAGEVISIBLE .
Parameters:
  isPageVisible - The isPageVisible to set.



setRulersVisible
public void setRulersVisible(boolean isRulersVisible)(Code)
Sets if the rulers are to be displayed. Fires a property change event for JGraphEditorDiagramPane.PROPERTY_RULERSVISIBLE .
Parameters:
  isRulersVisible - The isRulersVisible to set.



updateMinimumSize
protected void updateMinimumSize()(Code)
Updates the minimum size of the graph according to the current state of the background page: if the page is not visible then the minimum size is set to null, otherwise the minimum size is set to the smallest area of pages containing the graph.



updateScale
protected void updateScale()(Code)
Updates the scale based on the autoscale policy. This implementation makes sure the JGraphEditorDiagramPane.autoScaleResetListener does not trigger an autoscale policy reset be temporary removing the listener from the graph while the scale is updated. The scale is computed using one of JGraphEditorDiagramPane.computeWindowScale(int) , JGraphEditorDiagramPane.computePageScale() and JGraphEditorDiagramPane.computePageWidthScale(int) .



Fields inherited from javax.swing.JScrollPane
protected JViewport columnHeader(Code)(Java Doc)
protected JScrollBar horizontalScrollBar(Code)(Java Doc)
protected int horizontalScrollBarPolicy(Code)(Java Doc)
protected Component lowerLeft(Code)(Java Doc)
protected Component lowerRight(Code)(Java Doc)
protected JViewport rowHeader(Code)(Java Doc)
protected Component upperLeft(Code)(Java Doc)
protected Component upperRight(Code)(Java Doc)
protected JScrollBar verticalScrollBar(Code)(Java Doc)
protected int verticalScrollBarPolicy(Code)(Java Doc)
protected JViewport viewport(Code)(Java Doc)

Methods inherited from javax.swing.JScrollPane
public JScrollBar createHorizontalScrollBar()(Code)(Java Doc)
public JScrollBar createVerticalScrollBar()(Code)(Java Doc)
protected JViewport createViewport()(Code)(Java Doc)
public AccessibleContext getAccessibleContext()(Code)(Java Doc)
public JViewport getColumnHeader()(Code)(Java Doc)
public Component getCorner(String key)(Code)(Java Doc)
public JScrollBar getHorizontalScrollBar()(Code)(Java Doc)
public int getHorizontalScrollBarPolicy()(Code)(Java Doc)
public JViewport getRowHeader()(Code)(Java Doc)
public ScrollPaneUI getUI()(Code)(Java Doc)
public String getUIClassID()(Code)(Java Doc)
public JScrollBar getVerticalScrollBar()(Code)(Java Doc)
public int getVerticalScrollBarPolicy()(Code)(Java Doc)
public JViewport getViewport()(Code)(Java Doc)
public Border getViewportBorder()(Code)(Java Doc)
public Rectangle getViewportBorderBounds()(Code)(Java Doc)
public boolean isValidateRoot()(Code)(Java Doc)
public boolean isWheelScrollingEnabled()(Code)(Java Doc)
protected String paramString()(Code)(Java Doc)
public void setColumnHeader(JViewport columnHeader)(Code)(Java Doc)
public void setColumnHeaderView(Component view)(Code)(Java Doc)
public void setComponentOrientation(ComponentOrientation co)(Code)(Java Doc)
public void setCorner(String key, Component corner)(Code)(Java Doc)
public void setHorizontalScrollBar(JScrollBar horizontalScrollBar)(Code)(Java Doc)
public void setHorizontalScrollBarPolicy(int policy)(Code)(Java Doc)
public void setLayout(LayoutManager layout)(Code)(Java Doc)
public void setRowHeader(JViewport rowHeader)(Code)(Java Doc)
public void setRowHeaderView(Component view)(Code)(Java Doc)
public void setUI(ScrollPaneUI ui)(Code)(Java Doc)
public void setVerticalScrollBar(JScrollBar verticalScrollBar)(Code)(Java Doc)
public void setVerticalScrollBarPolicy(int policy)(Code)(Java Doc)
public void setViewport(JViewport viewport)(Code)(Java Doc)
public void setViewportBorder(Border viewportBorder)(Code)(Java Doc)
public void setViewportView(Component view)(Code)(Java Doc)
public void setWheelScrollingEnabled(boolean handleWheel)(Code)(Java Doc)
public void updateUI()(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.