Source Code Cross Referenced for ViewSettings.java in  » Testing » KeY » de » uka » ilkd » key » gui » configuration » 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 » Testing » KeY » de.uka.ilkd.key.gui.configuration 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // This file is part of KeY - Integrated Deductive Software Design
002:        // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
003:        //                         Universitaet Koblenz-Landau, Germany
004:        //                         Chalmers University of Technology, Sweden
005:        //
006:        // The KeY system is protected by the GNU General Public License. 
007:        // See LICENSE.TXT for details.
008:        //
009:        //
010:        package de.uka.ilkd.key.gui.configuration;
011:
012:        import java.util.Iterator;
013:        import java.util.LinkedList;
014:        import java.util.Properties;
015:
016:        import org.apache.log4j.Logger;
017:
018:        import de.uka.ilkd.key.gui.GUIEvent;
019:
020:        /** 
021:         * This class encapsulates information about:
022:         * 1) relative font size in the prover view
023:         * 2) the maximal number of lines a tooltip with instantiated SchemaVariables
024:         *    is allowed to have. If this number is exceeded no SchemaVariables get
025:         *    instantiated in the displayed tooltip.
026:         * 3) wether intermediate proofsteps should be hidden in the proof tree view
027:         */
028:        public class ViewSettings implements  Settings {
029:            static Logger logger = Logger.getLogger(ViewSettings.class
030:                    .getName());
031:            private static final String MAX_TOOLTIP_LINES_KEY = "[View]MaxTooltipLines";
032:            private static final String SHOW_WHOLE_TACLET = "[View]ShowWholeTaclet";
033:            private static final String FONT_INDEX = "[View]FontIndex";
034:            private static final String HIDE_INTERMEDIATE_PROOFSTEPS = "[View]HideIntermediateProofsteps";
035:
036:            /** default max number of displayed tooltip lines is 40 */
037:            private int maxTooltipLines = 40;
038:            /** do not print the find, varcond and heuristics part of taclets in
039:             * the TacletMenu by default */
040:            private boolean showWholeTaclet = false;
041:            /** default fontsize */
042:            private int sizeIndex = 2;
043:            /** do not hide intermediate proofsteps by default */
044:            private boolean hideIntermediateProofsteps = false;
045:
046:            private LinkedList listenerList = new LinkedList();
047:
048:            /**
049:             * @return the current maxTooltipLines
050:             */
051:            public int getMaxTooltipLines() {
052:                return maxTooltipLines;
053:            }
054:
055:            /**
056:             * Sets maxTooltipLines 
057:             * @param b The new value for maxTooltipLines 
058:             */
059:            public void setMaxTooltipLines(int b) {
060:                if (b != maxTooltipLines) {
061:                    maxTooltipLines = b;
062:                    fireSettingsChanged();
063:                }
064:            }
065:
066:            /**
067:             * returns whether the Find and VarCond part of Taclets should be
068:             * pretty-printed with instantiations of schema-variables or not
069:             * 
070:             * @return true iff the find part should be pretty-printed instantiated
071:             */
072:            public boolean getShowWholeTaclet() {
073:                return showWholeTaclet;
074:            }
075:
076:            /**
077:             * Sets whether the Find and VarCond part of Taclets should be
078:             * pretty-printed with instantiations of schema-variables or not
079:             * 
080:             * @param b
081:             *           indicates whether the Find and VarCond part of Taclets should
082:             *           be pretty-printed with instantiations of schema-variables or
083:             *           not
084:             */
085:            public void setShowWholeTaclet(boolean b) {
086:                if (b != showWholeTaclet) {
087:                    showWholeTaclet = b;
088:                    fireSettingsChanged();
089:                }
090:            }
091:
092:            /**
093:             * @return the current sizeIndex
094:             */
095:            public int sizeIndex() {
096:                return sizeIndex;
097:            }
098:
099:            /**
100:             * Sets FontIndex
101:             * @param b The new value for SizeIndex 
102:             */
103:            public void setFontIndex(int b) {
104:                if (b != sizeIndex) {
105:                    sizeIndex = b;
106:                    fireSettingsChanged();
107:                }
108:            }
109:
110:            /**
111:             * @return true iff intermediate proofsteps should be hidden
112:             */
113:            public boolean getHideIntermediateProofsteps() {
114:                return hideIntermediateProofsteps;
115:            }
116:
117:            /**
118:             * @param hide Wether intermediate proofsteps should be hidden
119:             */
120:            public void setHideIntermediateProofsteps(boolean hide) {
121:                if (hide != hideIntermediateProofsteps) {
122:                    hideIntermediateProofsteps = hide;
123:                    fireSettingsChanged();
124:                }
125:            }
126:
127:            /** gets a Properties object and has to perform the necessary
128:             * steps in order to change this object in a way that it
129:             * represents the stored settings
130:             * @param props the collection of properties  
131:             */
132:            public void readSettings(Properties props) {
133:                String val1 = props.getProperty(MAX_TOOLTIP_LINES_KEY);
134:                String val2 = props.getProperty(FONT_INDEX);
135:                String val3 = props.getProperty(SHOW_WHOLE_TACLET);
136:                String val4 = props.getProperty(HIDE_INTERMEDIATE_PROOFSTEPS);
137:                if (val1 != null) {
138:                    maxTooltipLines = Integer.valueOf(val1).intValue();
139:                }
140:                if (val2 != null) {
141:                    sizeIndex = Integer.valueOf(val2).intValue();
142:                }
143:                if (val3 != null) {
144:                    showWholeTaclet = Boolean.valueOf(val3).booleanValue();
145:                }
146:                if (val4 != null) {
147:                    hideIntermediateProofsteps = Boolean.valueOf(val4)
148:                            .booleanValue();
149:                }
150:            }
151:
152:            /**
153:             * implements the method required by the Settings interface. The settings
154:             * are written to the given Properties object. Only entries of the form
155:             * <key>=<value>(, <value>)* are allowed.
156:             * 
157:             * @param props
158:             *           the Properties object where to write the settings as (key,
159:             *           value) pair
160:             */
161:            public void writeSettings(Properties props) {
162:                props.setProperty(MAX_TOOLTIP_LINES_KEY, "" + maxTooltipLines);
163:                props.setProperty(SHOW_WHOLE_TACLET, "" + showWholeTaclet);
164:                props.setProperty(FONT_INDEX, "" + sizeIndex);
165:                props.setProperty(HIDE_INTERMEDIATE_PROOFSTEPS, ""
166:                        + hideIntermediateProofsteps);
167:            }
168:
169:            /** sends the message that the state of this setting has been
170:             * changed to its registered listeners (not thread-safe)
171:             */
172:            protected void fireSettingsChanged() {
173:                Iterator it = listenerList.iterator();
174:                while (it.hasNext()) {
175:                    ((SettingsListener) it.next())
176:                            .settingsChanged(new GUIEvent(this ));
177:                }
178:            }
179:
180:            /** 
181:             * adds a listener to the settings object 
182:             * @param l the listener
183:             */
184:            public void addSettingsListener(SettingsListener l) {
185:                listenerList.add(l);
186:            }
187:
188:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.