Source Code Cross Referenced for Database.java in  » UML » umlet » com » umlet » element » custom » 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 » UML » umlet » com.umlet.element.custom 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package com.umlet.element.custom;
02:
03:        import java.awt.*;
04:        import java.util.*;
05:        import com.umlet.control.*;
06:        import com.umlet.element.base.Entity;
07:
08:        public class Database extends com.umlet.element.base.Entity {
09:
10:            // Change this method if you want to edit the graphical
11:            // representation of your custom element.
12:            public void paint(Graphics g) {
13:
14:                // Some unimportant initialization stuff; setting color, font
15:                // quality, etc. You should not have to change this.
16:                Graphics2D g2 = (Graphics2D) g;
17:                g2.setFont(Constants.getFont());
18:                g2.setColor(_activeColor);
19:                Constants.getFRC(g2);
20:
21:                int inset = Constants.getFontsize();
22:
23:                // It's getting interesting here:
24:                // First, the strings you type in the element editor are read and
25:                // split into lines.
26:                // Then, by default, they are printed out on the element, aligned
27:                // to the left.
28:                // Change this to modify this default text printing and to react
29:                // to special strings
30:                // (like the "--" string in the UML class elements which draw a line).
31:                Vector tmp = Constants.decomposeStrings(this 
32:                        .getPanelAttributes(), "\n");
33:                int yPos = inset + Constants.getDistLineToText();
34:                boolean CENTER = true;
35:                for (int i = 0; i < tmp.size(); i++) {
36:                    String s = (String) tmp.elementAt(i);
37:                    if (s.equals("--")) {
38:                        CENTER = false;
39:                        g2.drawLine(0, yPos, this .getWidth(), yPos);
40:                        yPos += Constants.getDistLineToText();
41:                    } else {
42:                        yPos += Constants.getFontsize();
43:                        if (CENTER) {
44:                            Constants.write(g2, s, this .getWidth() / 2, yPos,
45:                                    true);
46:                        } else {
47:                            Constants.write(g2, s, Constants.getFontsize() / 2,
48:                                    yPos, false);
49:                        }
50:                        yPos += Constants.getDistTextToText();
51:                    }
52:                }
53:
54:                // Finally, change other graphical attributes using
55:                // drawLine, getWidth, getHeight..
56:                g2.drawLine(0, this .getHeight() - 1 - inset / 2, 0, inset / 2);
57:                g2.drawOval(0, 0, this .getWidth(), inset);
58:                g2.drawArc(0, this .getHeight() - 1 - inset, this .getWidth(),
59:                        Constants.getFontsize(), 180, 180);
60:                g2.drawLine(this .getWidth() - 1, inset / 2,
61:                        this .getWidth() - 1, this .getHeight() - 1 - inset / 2);
62:            }
63:
64:            // Change this method if you want to set the resize-attributes of
65:            // your custom element
66:            public int getPossibleResizeDirections() {
67:                // Remove from this list the borders you don't want to be resizeable.
68:                return Constants.RESIZE_TOP | Constants.RESIZE_LEFT
69:                        | Constants.RESIZE_BOTTOM | Constants.RESIZE_RIGHT;
70:            }
71:
72:            // Advanced: change this method to modify the area where relations
73:            // stick to your custom element.
74:            public StickingPolygon getStickingBorder() {
75:                // By default, the element returns its outer borders. Change it,
76:                // if your element needs to stick to relations differently.
77:                // See, for example, the source code of the UML interface element.
78:                StickingPolygon p = new StickingPolygon();
79:                p.addLine(new Point(0, 0), new Point(this .getWidth() - 1, 0),
80:                        Constants.RESIZE_TOP);
81:                p.addLine(new Point(this .getWidth() - 1, 0), new Point(this 
82:                        .getWidth() - 1, this .getHeight() - 1),
83:                        Constants.RESIZE_RIGHT);
84:                p.addLine(new Point(this .getWidth() - 1, this .getHeight() - 1),
85:                        new Point(0, this .getHeight() - 1),
86:                        Constants.RESIZE_BOTTOM);
87:                p.addLine(new Point(0, this .getHeight() - 1), new Point(0, 0),
88:                        Constants.RESIZE_LEFT);
89:                return p;
90:            }
91:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.