Source Code Cross Referenced for ElementPropertyParameter.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » gui » old » 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 » Web Framework » rife 1.6.1 » com.uwyn.rife.gui.old 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
003:         * Distributed under the terms of either:
004:         * - the common development and distribution license (CDDL), v1.0; or
005:         * - the GNU Lesser General Public License, v2.1 or later
006:         * $Id: ElementPropertyParameter.java 3634 2007-01-08 21:42:24Z gbevin $
007:         */
008:        package com.uwyn.rife.gui.old;
009:
010:        import java.awt.*;
011:        import java.awt.geom.Rectangle2D;
012:
013:        import javax.swing.JMenuItem;
014:        import javax.swing.JPopupMenu;
015:        import javax.swing.JTextField;
016:
017:        import com.uwyn.rife.swing.MouseMotionEventTranslator;
018:        import com.uwyn.rife.tools.Localization;
019:
020:        abstract class ElementPropertyParameter extends ElementProperty {
021:            public ElementPropertyParameter(Element element, String name) {
022:                super (element, name);
023:            }
024:
025:            public void draw(Graphics2D g2d) {
026:                Rectangle clip = g2d.getClipBounds();
027:                if (clip == null || clip.intersects(getNameBounds())) {
028:                    Color backgroundColor = null;
029:                    ElementStyle element_style = getElement()
030:                            .getElementStyleScaled();
031:                    if (getElement().isSelected()) {
032:                        backgroundColor = element_style.mBodyBackgroundColorSelected;
033:                    } else {
034:                        backgroundColor = element_style.mBodyBackgroundColor;
035:                    }
036:                    element_style
037:                            .drawParameterText(
038:                                    g2d,
039:                                    getName(),
040:                                    backgroundColor,
041:                                    (int) (getNameBounds().getX()
042:                                            + getNameBounds().getWidth() - element_style.mParamFontLineMetrics
043:                                            .getDescent()),
044:                                    (int) (getNameBounds().getY() + getNameBounds()
045:                                            .getHeight()));
046:                }
047:            }
048:
049:            public Color getColor() {
050:                return getElement().getElementStyleScaled().mParamTextColor;
051:            }
052:
053:            public Font getDrawFont() {
054:                return getElement().getElementStyleScaled().mParamFont;
055:            }
056:
057:            public Font getEditFont() {
058:                return getElement().getElementStyleScaled().mParamFont;
059:            }
060:
061:            public int getEditAlignment() {
062:                return JTextField.CENTER;
063:            }
064:
065:            public Rectangle getEditRectangle(Point clickedPoint) {
066:                ElementStyle element_style = getElement()
067:                        .getElementStyleScaled();
068:                Rectangle2D title_rect_outside_bounds = getElement()
069:                        .getTitleRectangleOutside().getBounds2D();
070:                int parameter_width = (int) (Math
071:                        .floor(title_rect_outside_bounds.getX()
072:                                + title_rect_outside_bounds.getWidth()) - Math
073:                        .ceil(element_style.mElementBorderWidth) * 2);
074:                int parameter_height = (int) (getEditFont().getLineMetrics("M",
075:                        element_style.mFontRenderContext).getHeight());
076:                int parameter_x = (int) Math
077:                        .ceil(element_style.mElementBorderWidth);
078:                int parameter_y = (int) (clickedPoint.getY() - parameter_height / 2);
079:                return new Rectangle(parameter_x, parameter_y, parameter_width,
080:                        parameter_height);
081:            }
082:
083:            protected void showPopupMenuReal(JPopupMenu popupMenu,
084:                    Point clickedPoint) {
085:                DynamicMenuBuilder menu_builder = new DynamicMenuBuilder();
086:                MouseMotionEventTranslator event_translator = new MouseMotionEventTranslator(
087:                        getElement());
088:                JMenuItem menu_item = null;
089:
090:                popupMenu.addMouseMotionListener(event_translator);
091:                menu_item = menu_builder
092:                        .addMenuItem(
093:                                popupMenu,
094:                                Localization
095:                                        .getString("rife.element.property.popupmenu.edit"),
096:                                new Edit(clickedPoint),
097:                                Localization
098:                                        .getChar("rife.element.property.popupmenu.edit.mnemonic"));
099:                menu_item.addMouseMotionListener(event_translator);
100:                menu_item = menu_builder
101:                        .addMenuItem(
102:                                popupMenu,
103:                                Localization
104:                                        .getString("rife.element.property.popupmenu.delete"),
105:                                new Delete(),
106:                                Localization
107:                                        .getChar("rife.element.property.popupmenu.delete.mnemonic"));
108:                menu_item.addMouseMotionListener(event_translator);
109:            }
110:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.