Revision 44263
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.api/src/main/java/org/gvsig/expressionevaluator/History.java | ||
---|---|---|
1 |
package org.gvsig.expressionevaluator; |
|
2 |
|
|
3 |
import org.gvsig.tools.util.UnmodifiableBasicList; |
|
4 |
|
|
5 |
/** |
|
6 |
* |
|
7 |
* @author jjdelcerro |
|
8 |
*/ |
|
9 |
public interface History extends UnmodifiableBasicList<Expression>{ |
|
10 |
|
|
11 |
public boolean add(Expression expression); |
|
12 |
|
|
13 |
public void clear(); |
|
14 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.api/src/main/java/org/gvsig/expressionevaluator/Bookmark.java | ||
---|---|---|
1 |
package org.gvsig.expressionevaluator; |
|
2 |
|
|
3 |
import org.gvsig.tools.util.LabeledValue; |
|
4 |
|
|
5 |
/** |
|
6 |
* |
|
7 |
* @author jjdelcerro |
|
8 |
*/ |
|
9 |
public interface Bookmark extends LabeledValue<Expression> { |
|
10 |
|
|
11 |
public String getName(); |
|
12 |
|
|
13 |
public void setName(String name); |
|
14 |
|
|
15 |
public void used(); |
|
16 |
|
|
17 |
public long getLastUse(); |
|
18 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.api/src/main/java/org/gvsig/expressionevaluator/ExpressionEvaluatorManager.java | ||
---|---|---|
49 | 49 |
public Collection<GrammarFactory> getGrammarFactories(); |
50 | 50 |
|
51 | 51 |
public Grammar createGrammar(String name); |
52 |
|
|
53 |
public Bookmarks getBookmarks(); |
|
54 |
|
|
55 |
public History getHistory(); |
|
52 | 56 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.api/src/main/java/org/gvsig/expressionevaluator/Bookmarks.java | ||
---|---|---|
1 |
package org.gvsig.expressionevaluator; |
|
2 |
|
|
3 |
import org.gvsig.tools.util.UnmodifiableBasicList; |
|
4 |
|
|
5 |
/** |
|
6 |
* |
|
7 |
* @author jjdelcerro |
|
8 |
*/ |
|
9 |
public interface Bookmarks extends UnmodifiableBasicList<Bookmark>{ |
|
10 |
|
|
11 |
public Bookmark add(Bookmark bookmark); |
|
12 |
|
|
13 |
public Bookmark add(String name, Expression expression); |
|
14 |
|
|
15 |
public boolean remove(Bookmark bookmark); |
|
16 |
|
|
17 |
public boolean remove(String bookmarkName); |
|
18 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/main/java/org/gvsig/expressionevaluator/impl/DefaultBookmarks.java | ||
---|---|---|
1 |
package org.gvsig.expressionevaluator.impl; |
|
2 |
|
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.Date; |
|
5 |
import java.util.Iterator; |
|
6 |
import java.util.List; |
|
7 |
import org.apache.commons.lang3.StringUtils; |
|
8 |
import org.gvsig.expressionevaluator.Bookmark; |
|
9 |
import org.gvsig.expressionevaluator.Bookmarks; |
|
10 |
import org.gvsig.expressionevaluator.Expression; |
|
11 |
import org.gvsig.tools.util.LabeledValueImpl; |
|
12 |
|
|
13 |
/** |
|
14 |
* |
|
15 |
* @author jjdelcerro |
|
16 |
*/ |
|
17 |
public class DefaultBookmarks |
|
18 |
implements Bookmarks |
|
19 |
{ |
|
20 |
|
|
21 |
public static class DefaultBookmark |
|
22 |
extends LabeledValueImpl<Expression> |
|
23 |
implements Bookmark |
|
24 |
{ |
|
25 |
|
|
26 |
private long lastUse; |
|
27 |
private String name; |
|
28 |
|
|
29 |
public DefaultBookmark(String name, Expression value) { |
|
30 |
super(name, value); |
|
31 |
this.name = name; |
|
32 |
this.used(); |
|
33 |
} |
|
34 |
|
|
35 |
@Override |
|
36 |
public final void used() { |
|
37 |
this.lastUse = new Date().getTime(); |
|
38 |
} |
|
39 |
|
|
40 |
@Override |
|
41 |
public long getLastUse() { |
|
42 |
return this.lastUse; |
|
43 |
} |
|
44 |
|
|
45 |
@Override |
|
46 |
public void setName(String name) { |
|
47 |
this.name = name; |
|
48 |
} |
|
49 |
|
|
50 |
@Override |
|
51 |
public String getName() { |
|
52 |
return this.name; |
|
53 |
} |
|
54 |
|
|
55 |
@Override |
|
56 |
public String getLabel() { |
|
57 |
return this.name; |
|
58 |
} |
|
59 |
} |
|
60 |
|
|
61 |
private final ArrayList<Bookmark> bookmarks; |
|
62 |
|
|
63 |
public DefaultBookmarks() { |
|
64 |
this.bookmarks = new ArrayList<>(); |
|
65 |
} |
|
66 |
|
|
67 |
@Override |
|
68 |
public boolean remove(String bookmarkName) { |
|
69 |
for (int i = 0; i < this.bookmarks.size(); i++) { |
|
70 |
Bookmark bookmark = this.bookmarks.get(i); |
|
71 |
if( StringUtils.equalsIgnoreCase(bookmarkName, bookmark.getName()) ) { |
|
72 |
this.bookmarks.remove(i); |
|
73 |
return true; |
|
74 |
} |
|
75 |
} |
|
76 |
return false; |
|
77 |
} |
|
78 |
|
|
79 |
@Override |
|
80 |
public List<Bookmark> toList() { |
|
81 |
return this.bookmarks; |
|
82 |
} |
|
83 |
|
|
84 |
@Override |
|
85 |
public boolean remove(Bookmark bookmark) { |
|
86 |
return this.bookmarks.remove(bookmark); |
|
87 |
} |
|
88 |
|
|
89 |
@Override |
|
90 |
public Bookmark add(Bookmark bookmark) { |
|
91 |
this.bookmarks.add(bookmark); |
|
92 |
return bookmark; |
|
93 |
} |
|
94 |
|
|
95 |
@Override |
|
96 |
public Bookmark add(String name, Expression expression) { |
|
97 |
DefaultBookmark bookmark = new DefaultBookmark(name, expression); |
|
98 |
this.bookmarks.add(bookmark); |
|
99 |
return bookmark; |
|
100 |
} |
|
101 |
|
|
102 |
@Override |
|
103 |
public boolean isEmpty() { |
|
104 |
return this.bookmarks.isEmpty(); |
|
105 |
} |
|
106 |
|
|
107 |
@Override |
|
108 |
public int size() { |
|
109 |
return this.bookmarks.size(); |
|
110 |
} |
|
111 |
|
|
112 |
@Override |
|
113 |
public Iterator<Bookmark> iterator() { |
|
114 |
return this.bookmarks.iterator(); |
|
115 |
} |
|
116 |
|
|
117 |
@Override |
|
118 |
public Bookmark get(int position) { |
|
119 |
return this.bookmarks.get(position); |
|
120 |
} |
|
121 |
|
|
122 |
|
|
123 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/main/java/org/gvsig/expressionevaluator/impl/DefaultHistory.java | ||
---|---|---|
1 |
package org.gvsig.expressionevaluator.impl; |
|
2 |
|
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.Collections; |
|
5 |
import java.util.Iterator; |
|
6 |
import java.util.List; |
|
7 |
import org.apache.commons.lang3.StringUtils; |
|
8 |
import org.gvsig.expressionevaluator.Expression; |
|
9 |
import org.gvsig.expressionevaluator.History; |
|
10 |
|
|
11 |
/** |
|
12 |
* |
|
13 |
* @author jjdelcerro |
|
14 |
*/ |
|
15 |
public class DefaultHistory |
|
16 |
implements History |
|
17 |
{ |
|
18 |
|
|
19 |
public int maxsize; |
|
20 |
public List<Expression> history; |
|
21 |
|
|
22 |
public DefaultHistory(int size) { |
|
23 |
this.maxsize = size; |
|
24 |
this.history = new ArrayList<>(); |
|
25 |
} |
|
26 |
|
|
27 |
@Override |
|
28 |
public boolean add(Expression element) { |
|
29 |
if( element == null || element.isPhraseEmpty() ) { |
|
30 |
return true; |
|
31 |
} |
|
32 |
if( !this.history.isEmpty() ) { |
|
33 |
Expression last = this.history.get(0); |
|
34 |
String lastPhrase = StringUtils.normalizeSpace(last.getPhrase()); |
|
35 |
String curPhrase = StringUtils.normalizeSpace(element.getPhrase()); |
|
36 |
if( StringUtils.equals(curPhrase, lastPhrase) ) { |
|
37 |
return true; |
|
38 |
} |
|
39 |
} |
|
40 |
this.history.add(0, element); |
|
41 |
if( this.history.size()>this.maxsize ) { |
|
42 |
this.history.remove(this.history.size()-1); |
|
43 |
} |
|
44 |
return true; |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
public List<Expression> toList() { |
|
49 |
return Collections.unmodifiableList(this.history); |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public void clear() { |
|
54 |
this.history.clear(); |
|
55 |
} |
|
56 |
|
|
57 |
@Override |
|
58 |
public boolean isEmpty() { |
|
59 |
return this.history.isEmpty(); |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
public int size() { |
|
64 |
return this.history.size(); |
|
65 |
} |
|
66 |
|
|
67 |
@Override |
|
68 |
public Iterator<Expression> iterator() { |
|
69 |
return this.history.iterator(); |
|
70 |
} |
|
71 |
|
|
72 |
@Override |
|
73 |
public Expression get(int position) { |
|
74 |
return this.history.get(position); |
|
75 |
} |
|
76 |
|
|
77 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/main/java/org/gvsig/expressionevaluator/impl/DefaultExpressionEvaluatorManager.java | ||
---|---|---|
5 | 5 |
import java.util.Collection; |
6 | 6 |
import java.util.HashMap; |
7 | 7 |
import java.util.Map; |
8 |
import org.gvsig.expressionevaluator.Bookmarks; |
|
8 | 9 |
import org.gvsig.expressionevaluator.Code; |
9 | 10 |
import org.gvsig.expressionevaluator.CodeBuilder; |
10 | 11 |
import org.gvsig.expressionevaluator.Expression; |
... | ... | |
18 | 19 |
import org.gvsig.expressionevaluator.SymbolTableFactory; |
19 | 20 |
import org.gvsig.expressionevaluator.Compiler; |
20 | 21 |
import org.gvsig.expressionevaluator.GrammarSet; |
22 |
import org.gvsig.expressionevaluator.History; |
|
21 | 23 |
import org.slf4j.Logger; |
22 | 24 |
import org.slf4j.LoggerFactory; |
23 | 25 |
|
... | ... | |
29 | 31 |
private Double accuracy; |
30 | 32 |
private final Map<String,SymbolTableFactory>symbolTableFactories; |
31 | 33 |
private final Map<String,GrammarFactory> grammarFactories; |
34 |
private Bookmarks bookmarks; |
|
35 |
private History history; |
|
32 | 36 |
|
33 | 37 |
public DefaultExpressionEvaluatorManager() { |
34 | 38 |
this.symbolTableFactories = new HashMap<>(); |
... | ... | |
191 | 195 |
} |
192 | 196 |
} |
193 | 197 |
|
198 |
@Override |
|
194 | 199 |
public Grammar createGrammar(String name) { |
195 | 200 |
DefaultGrammar grammar = new DefaultGrammar(name); |
196 | 201 |
return grammar; |
197 | 202 |
} |
203 |
|
|
204 |
@Override |
|
205 |
public Bookmarks getBookmarks() { |
|
206 |
if( this.bookmarks==null ) { |
|
207 |
this.bookmarks = new DefaultBookmarks(); |
|
208 |
} |
|
209 |
return this.bookmarks; |
|
210 |
} |
|
211 |
|
|
212 |
@Override |
|
213 |
public History getHistory() { |
|
214 |
if( this.history==null ) { |
|
215 |
this.history = new DefaultHistory(20); |
|
216 |
} |
|
217 |
return this.history; |
|
218 |
} |
|
198 | 219 |
} |
199 | 220 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.api/src/main/java/org/gvsig/expressionevaluator/swing/JExpressionPicker.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
public ExpressionPickerController getController(); |
13 | 13 |
|
14 |
public Expression getExpressionWithOutHistory(); |
|
15 |
|
|
14 | 16 |
public Expression getExpression(); |
15 | 17 |
|
16 | 18 |
public void setExpression(Expression expression); |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.api/src/main/java/org/gvsig/expressionevaluator/swing/Element.java | ||
---|---|---|
1 | 1 |
package org.gvsig.expressionevaluator.swing; |
2 | 2 |
|
3 |
import java.util.Collection; |
|
3 | 4 |
import java.util.Iterator; |
4 | 5 |
import java.util.List; |
5 | 6 |
import javax.swing.ImageIcon; |
... | ... | |
32 | 33 |
|
33 | 34 |
public List<Element> getElements(); |
34 | 35 |
|
35 |
public boolean hasSubgroups(); |
|
36 |
|
|
37 |
public boolean hasMoreElements(); |
|
38 | 36 |
} |
39 | 37 |
|
40 | 38 |
public interface FunctionElement extends SimpleElement { |
... | ... | |
59 | 57 |
public String getIconName(); |
60 | 58 |
|
61 | 59 |
public ImageIcon getIcon(); |
60 |
|
|
61 |
public Collection<Element> getValues(); |
|
62 | 62 |
|
63 |
public boolean hasMoreValues(); |
|
64 |
|
|
63 | 65 |
public Component getAditionalPanel(JExpressionBuilder expressionBuilder); |
64 | 66 |
|
65 | 67 |
public boolean isEnabled(); |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.api/src/main/java/org/gvsig/expressionevaluator/swing/spi/AbstractElement.java | ||
---|---|---|
1 | 1 |
package org.gvsig.expressionevaluator.swing.spi; |
2 | 2 |
|
3 |
import java.util.Collection; |
|
4 |
import java.util.Collections; |
|
3 | 5 |
import java.util.Objects; |
4 | 6 |
import javax.swing.ImageIcon; |
5 | 7 |
import org.gvsig.expressionevaluator.swing.Element; |
... | ... | |
22 | 24 |
final Object value; |
23 | 25 |
final String iconName; |
24 | 26 |
final ImageIcon icon; |
25 |
private final String name;
|
|
27 |
private String name; |
|
26 | 28 |
private ExpressionBuilderConfig config; |
27 | 29 |
|
28 | 30 |
protected AbstractElement(String name) { |
... | ... | |
71 | 73 |
return this.name; |
72 | 74 |
} |
73 | 75 |
|
76 |
protected void setName(String name) { |
|
77 |
this.name = name; |
|
78 |
} |
|
79 |
|
|
74 | 80 |
@Override |
75 | 81 |
public Object getValue() { |
76 | 82 |
return this.value; |
77 | 83 |
} |
78 | 84 |
|
79 | 85 |
@Override |
86 |
public Collection<Element> getValues() { |
|
87 |
return Collections.EMPTY_LIST; |
|
88 |
} |
|
89 |
|
|
90 |
@Override |
|
91 |
public boolean hasMoreValues() { |
|
92 |
return false; |
|
93 |
} |
|
94 |
|
|
95 |
@Override |
|
80 | 96 |
public String getRenderedValue() { |
81 | 97 |
return Objects.toString(this.value); |
82 | 98 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.api/src/main/java/org/gvsig/expressionevaluator/swing/JExpressionBuilder.java | ||
---|---|---|
9 | 9 |
*/ |
10 | 10 |
public interface JExpressionBuilder extends Component, ExpressionBuilderConfig { |
11 | 11 |
|
12 |
public Expression getExpressionWithOutHistory(); |
|
13 |
|
|
12 | 14 |
public Expression getExpression(); |
13 | 15 |
|
14 | 16 |
public void setExpression(Expression expression); |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.api/src/main/java/org/gvsig/expressionevaluator/swing/ExpressionPickerController.java | ||
---|---|---|
23 | 23 |
@Override |
24 | 24 |
public Expression get(); |
25 | 25 |
|
26 |
public Expression getWithOutHistory(); |
|
26 | 27 |
|
27 | 28 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultHistoryPanelView.java | ||
---|---|---|
1 |
package org.gvsig.expressionevaluator.swing.impl; |
|
2 |
|
|
3 |
import com.jeta.open.i18n.I18NUtils; |
|
4 |
import com.jgoodies.forms.layout.CellConstraints; |
|
5 |
import com.jgoodies.forms.layout.FormLayout; |
|
6 |
import java.awt.BorderLayout; |
|
7 |
import java.awt.ComponentOrientation; |
|
8 |
import java.awt.Container; |
|
9 |
import java.awt.Dimension; |
|
10 |
import javax.swing.Box; |
|
11 |
import javax.swing.ImageIcon; |
|
12 |
import javax.swing.JFrame; |
|
13 |
import javax.swing.JList; |
|
14 |
import javax.swing.JPanel; |
|
15 |
import javax.swing.JScrollPane; |
|
16 |
import javax.swing.JTextArea; |
|
17 |
|
|
18 |
|
|
19 |
public class DefaultHistoryPanelView extends JPanel |
|
20 |
{ |
|
21 |
JList lstHistory = new JList(); |
|
22 |
JTextArea txtFormula = new JTextArea(); |
|
23 |
|
|
24 |
/** |
|
25 |
* Default constructor |
|
26 |
*/ |
|
27 |
public DefaultHistoryPanelView() |
|
28 |
{ |
|
29 |
initializePanel(); |
|
30 |
} |
|
31 |
|
|
32 |
/** |
|
33 |
* Adds fill components to empty cells in the first row and first column of the grid. |
|
34 |
* This ensures that the grid spacing will be the same as shown in the designer. |
|
35 |
* @param cols an array of column indices in the first row where fill components should be added. |
|
36 |
* @param rows an array of row indices in the first column where fill components should be added. |
|
37 |
*/ |
|
38 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
|
39 |
{ |
|
40 |
Dimension filler = new Dimension(10,10); |
|
41 |
|
|
42 |
boolean filled_cell_11 = false; |
|
43 |
CellConstraints cc = new CellConstraints(); |
|
44 |
if ( cols.length > 0 && rows.length > 0 ) |
|
45 |
{ |
|
46 |
if ( cols[0] == 1 && rows[0] == 1 ) |
|
47 |
{ |
|
48 |
/** add a rigid area */ |
|
49 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
|
50 |
filled_cell_11 = true; |
|
51 |
} |
|
52 |
} |
|
53 |
|
|
54 |
for( int index = 0; index < cols.length; index++ ) |
|
55 |
{ |
|
56 |
if ( cols[index] == 1 && filled_cell_11 ) |
|
57 |
{ |
|
58 |
continue; |
|
59 |
} |
|
60 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
|
61 |
} |
|
62 |
|
|
63 |
for( int index = 0; index < rows.length; index++ ) |
|
64 |
{ |
|
65 |
if ( rows[index] == 1 && filled_cell_11 ) |
|
66 |
{ |
|
67 |
continue; |
|
68 |
} |
|
69 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
|
70 |
} |
|
71 |
|
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* Helper method to load an image file from the CLASSPATH |
|
76 |
* @param imageName the package and name of the file to load relative to the CLASSPATH |
|
77 |
* @return an ImageIcon instance with the specified image file |
|
78 |
* @throws IllegalArgumentException if the image resource cannot be loaded. |
|
79 |
*/ |
|
80 |
public ImageIcon loadImage( String imageName ) |
|
81 |
{ |
|
82 |
try |
|
83 |
{ |
|
84 |
ClassLoader classloader = getClass().getClassLoader(); |
|
85 |
java.net.URL url = classloader.getResource( imageName ); |
|
86 |
if ( url != null ) |
|
87 |
{ |
|
88 |
ImageIcon icon = new ImageIcon( url ); |
|
89 |
return icon; |
|
90 |
} |
|
91 |
} |
|
92 |
catch( Exception e ) |
|
93 |
{ |
|
94 |
e.printStackTrace(); |
|
95 |
} |
|
96 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
|
97 |
} |
|
98 |
|
|
99 |
/** |
|
100 |
* Method for recalculating the component orientation for |
|
101 |
* right-to-left Locales. |
|
102 |
* @param orientation the component orientation to be applied |
|
103 |
*/ |
|
104 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
|
105 |
{ |
|
106 |
// Not yet implemented... |
|
107 |
// I18NUtils.applyComponentOrientation(this, orientation); |
|
108 |
super.applyComponentOrientation(orientation); |
|
109 |
} |
|
110 |
|
|
111 |
public JPanel createPanel() |
|
112 |
{ |
|
113 |
JPanel jpanel1 = new JPanel(); |
|
114 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(0.8),CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(0.2),CENTER:2DLU:NONE"); |
|
115 |
CellConstraints cc = new CellConstraints(); |
|
116 |
jpanel1.setLayout(formlayout1); |
|
117 |
|
|
118 |
lstHistory.setName("lstHistory"); |
|
119 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
120 |
jscrollpane1.setViewportView(lstHistory); |
|
121 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
122 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
123 |
jpanel1.add(jscrollpane1,cc.xy(2,2)); |
|
124 |
|
|
125 |
txtFormula.setName("txtFormula"); |
|
126 |
JScrollPane jscrollpane2 = new JScrollPane(); |
|
127 |
jscrollpane2.setViewportView(txtFormula); |
|
128 |
jscrollpane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
129 |
jscrollpane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
130 |
jpanel1.add(jscrollpane2,cc.xy(2,4)); |
|
131 |
|
|
132 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5 }); |
|
133 |
return jpanel1; |
|
134 |
} |
|
135 |
|
|
136 |
/** |
|
137 |
* Initializer |
|
138 |
*/ |
|
139 |
protected void initializePanel() |
|
140 |
{ |
|
141 |
setLayout(new BorderLayout()); |
|
142 |
add(createPanel(), BorderLayout.CENTER); |
|
143 |
} |
|
144 |
|
|
145 |
|
|
146 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultJExpressionBuilder.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.awt.BorderLayout; |
4 | 4 |
import java.awt.Dimension; |
5 |
import java.awt.Point; |
|
5 | 6 |
import java.awt.Toolkit; |
6 | 7 |
import java.awt.datatransfer.Clipboard; |
7 | 8 |
import java.awt.datatransfer.StringSelection; |
... | ... | |
47 | 48 |
import org.apache.commons.io.FilenameUtils; |
48 | 49 |
import org.apache.commons.io.IOUtils; |
49 | 50 |
import org.apache.commons.lang3.StringUtils; |
51 |
import org.gvsig.expressionevaluator.Bookmark; |
|
52 |
import org.gvsig.expressionevaluator.Bookmarks; |
|
50 | 53 |
import org.gvsig.expressionevaluator.Expression; |
51 | 54 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator; |
55 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorManager; |
|
56 |
import org.gvsig.expressionevaluator.History; |
|
52 | 57 |
import org.gvsig.expressionevaluator.SymbolTable; |
53 | 58 |
import org.gvsig.expressionevaluator.swing.Element; |
54 | 59 |
import org.gvsig.expressionevaluator.swing.Element.GroupElement; |
... | ... | |
65 | 70 |
import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
66 | 71 |
import org.gvsig.tools.swing.api.script.ScriptSwingManager; |
67 | 72 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
73 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
74 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
75 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
68 | 76 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
69 | 77 |
|
70 | 78 |
/** |
... | ... | |
77 | 85 |
implements JExpressionBuilder { |
78 | 86 |
|
79 | 87 |
private final ExpressionEvaluatorSwingManager manager; |
80 |
private GroupElement currentGroup;
|
|
88 |
private Element currentElement;
|
|
81 | 89 |
private PickerController<List<Script>> scriptPicker; |
82 | 90 |
private ScriptSwingManager.ScriptEditor scriptEditor; |
83 | 91 |
|
... | ... | |
200 | 208 |
|
201 | 209 |
private void reload(Element element) { |
202 | 210 |
if (element instanceof Element) { |
203 |
if (element instanceof GroupElement) { |
|
211 |
// if (element instanceof GroupElement) {
|
|
204 | 212 |
reload(element); |
205 |
} |
|
213 |
// }
|
|
206 | 214 |
element.reload(); |
207 | 215 |
} |
208 | 216 |
} |
... | ... | |
210 | 218 |
private List<Element> getChilds(final GroupElement node) { |
211 | 219 |
List<Element> x = new ArrayList<>(); |
212 | 220 |
for (Element element : node.getElements()) { |
213 |
if (element instanceof GroupElement) { |
|
221 |
// if (element instanceof GroupElement) {
|
|
214 | 222 |
x.add(element); |
215 |
} |
|
223 |
// }
|
|
216 | 224 |
} |
217 | 225 |
return x; //node.getElements(); |
218 | 226 |
} |
... | ... | |
232 | 240 |
|
233 | 241 |
@Override |
234 | 242 |
public boolean isLeaf(Object node) { |
235 |
if( node instanceof GroupElement ) { |
|
236 |
return !((GroupElement) node).hasSubgroups(); |
|
237 |
} |
|
238 |
return false; |
|
243 |
return !(node instanceof GroupElement); |
|
239 | 244 |
} |
240 | 245 |
|
241 | 246 |
@Override |
... | ... | |
302 | 307 |
) { |
303 | 308 |
@Override |
304 | 309 |
protected Expression getExpression() { |
305 |
return DefaultJExpressionBuilder.this.getExpression(); |
|
310 |
return DefaultJExpressionBuilder.this.getExpressionWithOutHistory();
|
|
306 | 311 |
} |
307 | 312 |
|
308 | 313 |
@Override |
... | ... | |
432 | 437 |
public void valueChanged(TreeSelectionEvent e) { |
433 | 438 |
TreePath path = e.getPath(); |
434 | 439 |
Element element = (Element) path.getLastPathComponent(); |
435 |
if (element instanceof GroupElement) { |
|
436 |
updateSimpleElementsList((GroupElement) element); |
|
437 |
} |
|
440 |
doSelectElement(element); |
|
441 |
updateSimpleElementsList(element); |
|
438 | 442 |
} |
439 | 443 |
}); |
440 | 444 |
this.treeElements.addMouseListener(new MouseAdapter() { |
... | ... | |
454 | 458 |
this.btnGroupElementInsert.addActionListener(new ActionListener() { |
455 | 459 |
@Override |
456 | 460 |
public void actionPerformed(ActionEvent e) { |
457 |
doInsert(txtGroupElement.getText()); |
|
461 |
if( currentElement!=null ) { |
|
462 |
doInsert(currentElement.getRenderedValue()); |
|
463 |
} else { |
|
464 |
doInsert(txtGroupElement.getText()); |
|
465 |
} |
|
458 | 466 |
} |
459 | 467 |
}); |
460 | 468 |
this.btnSimpleElementInsert.addActionListener(new ActionListener() { |
... | ... | |
620 | 628 |
|
621 | 629 |
this.tabExpressionBuilder.setEnabledAt(0, this.builderConfig.getPreferences().getScriptsEnabled()); |
622 | 630 |
|
631 |
this.btnHistory.addActionListener(new ActionListener() { |
|
632 |
@Override |
|
633 |
public void actionPerformed(ActionEvent e) { |
|
634 |
doHistory(); |
|
635 |
} |
|
636 |
}); |
|
637 |
|
|
638 |
this.btnBookmarks.addActionListener(new ActionListener() { |
|
639 |
@Override |
|
640 |
public void actionPerformed(ActionEvent e) { |
|
641 |
doBookmarks(); |
|
642 |
} |
|
643 |
}); |
|
644 |
|
|
645 |
|
|
623 | 646 |
this.infoPanel.repaint(); |
624 | 647 |
|
625 |
this.setPreferredSize(new Dimension(650, 350));
|
|
648 |
this.setPreferredSize(new Dimension(750, 450));
|
|
626 | 649 |
|
627 | 650 |
|
628 | 651 |
Dimension dim = this.getPreferredSize(); |
... | ... | |
650 | 673 |
return this.txtExpression.getText(); |
651 | 674 |
} |
652 | 675 |
|
676 |
@Override |
|
653 | 677 |
public void setText(String text) { |
654 | 678 |
this.txtExpression.setText(text); |
655 | 679 |
} |
... | ... | |
688 | 712 |
// } |
689 | 713 |
} |
690 | 714 |
|
691 |
private void updateSimpleElementsList(GroupElement group) {
|
|
715 |
private void updateSimpleElementsList(Element element) {
|
|
692 | 716 |
FilteredListModel model = new FilteredListModel(); |
693 | 717 |
model.addElement("Loading..."); |
694 |
this.currentGroup = group;
|
|
695 |
this.txtGroupElement.setText(group.getName());
|
|
718 |
this.currentElement = element;
|
|
719 |
this.txtGroupElement.setText(element.getName());
|
|
696 | 720 |
this.txtSimpleElementFilter.setText(""); |
697 |
this.infoPanel.clean(); |
|
698 |
this.infoPanel.repaint(); |
|
699 |
if (group instanceof SimpleElement) {
|
|
721 |
// this.infoPanel.clean();
|
|
722 |
// this.infoPanel.repaint();
|
|
723 |
if (element instanceof SimpleElement) {
|
|
700 | 724 |
this.btnGroupElementInsert.setEnabled(true); |
701 | 725 |
} else { |
702 | 726 |
this.btnGroupElementInsert.setEnabled(false); |
... | ... | |
714 | 738 |
} |
715 | 739 |
|
716 | 740 |
private void simpleElementsUpdater() { |
717 |
final GroupElement group = this.currentGroup;
|
|
741 |
final Element element = this.currentElement;
|
|
718 | 742 |
final FilteredListModel model = new FilteredListModel(); |
719 |
for (Element child : group) { |
|
720 |
if (group != this.currentGroup) { |
|
743 |
for (Element value : element.getValues()) { |
|
744 |
if (element != this.currentElement) { |
|
745 |
// Como estamos en otro hilo, cuando el usuario cambia de elemento, |
|
746 |
// cancelamos las actualizaciones que teniamos en curso. |
|
721 | 747 |
return; |
722 | 748 |
} |
723 |
if (child instanceof SimpleElement) {
|
|
724 |
model.addElement(child);
|
|
749 |
if (value instanceof SimpleElement) {
|
|
750 |
model.addElement(value);
|
|
725 | 751 |
} |
726 | 752 |
} |
727 | 753 |
model.sort(true); |
728 | 754 |
SwingUtilities.invokeLater(new Runnable() { |
729 | 755 |
@Override |
730 | 756 |
public void run() { |
731 |
if (group != currentGroup) {
|
|
757 |
if (element != currentElement) {
|
|
732 | 758 |
return; |
733 | 759 |
} |
734 |
if( group.hasMoreElements() ) {
|
|
760 |
if( element.hasMoreValues()) {
|
|
735 | 761 |
lblSimpleElementsMsg.setText("More elements..."); |
736 | 762 |
} else { |
737 | 763 |
lblSimpleElementsMsg.setText(""); |
... | ... | |
745 | 771 |
|
746 | 772 |
@Override |
747 | 773 |
public Expression getExpression() { |
774 |
Expression expression = this.getExpressionWithOutHistory(); |
|
775 |
ExpressionEvaluatorManager theManager = ExpressionEvaluatorLocator.getManager(); |
|
776 |
theManager.getHistory().add(expression); |
|
777 |
return expression; |
|
778 |
} |
|
779 |
|
|
780 |
@Override |
|
781 |
public Expression getExpressionWithOutHistory() { |
|
748 | 782 |
String phrase = this.txtExpression.getText(); |
749 | 783 |
if (StringUtils.isEmpty(phrase)) { |
750 | 784 |
return null; |
... | ... | |
901 | 935 |
} |
902 | 936 |
} |
903 | 937 |
} |
938 |
|
|
939 |
private void doHistory() { |
|
940 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
941 |
ExpressionEvaluatorManager theManager = ExpressionEvaluatorLocator.getManager(); |
|
942 |
JPopupMenu popup = new JPopupMenu(); |
|
943 |
History history = theManager.getHistory(); |
|
944 |
if( !history.isEmpty() ) { |
|
945 |
for (Expression expression : history) { |
|
946 |
popup.add(createHistoryMenuItem(expression)); |
|
947 |
} |
|
948 |
popup.addSeparator(); |
|
949 |
} |
|
950 |
JMenuItem showAllHistory = new JMenuItem(i18n.getTranslation("_Show_all_history")); |
|
951 |
showAllHistory.addActionListener(new ActionListener() { |
|
952 |
@Override |
|
953 |
public void actionPerformed(ActionEvent e) { |
|
954 |
doShowHistoryDialog(); |
|
955 |
} |
|
956 |
}); |
|
957 |
popup.add(showAllHistory); |
|
958 |
Point p = this.btnHistory.getLocationOnScreen(); |
|
959 |
popup.show(this.btnHistory, 0, this.btnHistory.getHeight()); |
|
960 |
} |
|
961 |
|
|
962 |
private JMenuItem createHistoryMenuItem(final Expression expression) { |
|
963 |
JMenuItem item = new JMenuItem(StringUtils.abbreviate(expression.getPhrase(), 45)); |
|
964 |
item.addActionListener(new ActionListener() { |
|
965 |
@Override |
|
966 |
public void actionPerformed(ActionEvent e) { |
|
967 |
setExpression(expression); |
|
968 |
} |
|
969 |
}); |
|
970 |
return item; |
|
971 |
} |
|
972 |
|
|
973 |
private void doShowHistoryDialog() { |
|
974 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
975 |
final DefaultHistoryPanel panel = new DefaultHistoryPanel(); |
|
976 |
final Dialog dialog = winManager.createDialog( |
|
977 |
panel, |
|
978 |
"History", |
|
979 |
null, |
|
980 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
981 |
); |
|
982 |
dialog.addActionListener(new ActionListener() { |
|
983 |
@Override |
|
984 |
public void actionPerformed(ActionEvent e) { |
|
985 |
if( dialog.getAction()!=WindowManager_v2.BUTTON_OK ) { |
|
986 |
return; |
|
987 |
} |
|
988 |
setExpression(panel.getExpression()); |
|
989 |
} |
|
990 |
}); |
|
991 |
dialog.show(WindowManager.MODE.DIALOG); |
|
992 |
} |
|
993 |
|
|
994 |
private void doBookmarks() { |
|
995 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
996 |
ExpressionEvaluatorManager theManager = ExpressionEvaluatorLocator.getManager(); |
|
997 |
JPopupMenu popup = new JPopupMenu(); |
|
998 |
JMenuItem addToBookmarks = new JMenuItem(i18n.getTranslation("_Add_to_bookmarks")); |
|
999 |
addToBookmarks.addActionListener(new ActionListener() { |
|
1000 |
@Override |
|
1001 |
public void actionPerformed(ActionEvent e) { |
|
1002 |
doShowBookmarksDialog(getExpressionWithOutHistory()); |
|
1003 |
} |
|
1004 |
}); |
|
1005 |
popup.add(addToBookmarks); |
|
1006 |
Bookmarks bookmarks = theManager.getBookmarks(); |
|
1007 |
if( !bookmarks.isEmpty() ) { |
|
1008 |
popup.addSeparator(); |
|
1009 |
for (Bookmark bookmark : bookmarks) { |
|
1010 |
popup.add(createBookmarkMenuItem(bookmark)); |
|
1011 |
} |
|
1012 |
popup.addSeparator(); |
|
1013 |
JMenuItem showAllBookmarks = new JMenuItem(i18n.getTranslation("_Show_all_bookmarks")); |
|
1014 |
showAllBookmarks.addActionListener(new ActionListener() { |
|
1015 |
@Override |
|
1016 |
public void actionPerformed(ActionEvent e) { |
|
1017 |
doShowBookmarksDialog(null); |
|
1018 |
} |
|
1019 |
}); |
|
1020 |
popup.add(showAllBookmarks); |
|
1021 |
} |
|
1022 |
Point p = this.btnBookmarks.getLocationOnScreen(); |
|
1023 |
popup.show(this.btnBookmarks, 0, this.btnBookmarks.getHeight()); |
|
1024 |
} |
|
1025 |
|
|
1026 |
private JMenuItem createBookmarkMenuItem(final Bookmark bookmark) { |
|
1027 |
JMenuItem item = new JMenuItem(StringUtils.abbreviate(bookmark.getName(), 45)); |
|
1028 |
item.addActionListener(new ActionListener() { |
|
1029 |
@Override |
|
1030 |
public void actionPerformed(ActionEvent e) { |
|
1031 |
setExpression(bookmark.getValue()); |
|
1032 |
} |
|
1033 |
}); |
|
1034 |
return item; |
|
1035 |
} |
|
1036 |
|
|
1037 |
private void doShowBookmarksDialog(Expression expression) { |
|
1038 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
1039 |
final DefaultBookmarksPanel panel = new DefaultBookmarksPanel(expression); |
|
1040 |
final Dialog dialog = winManager.createDialog( |
|
1041 |
panel, |
|
1042 |
"Bookmarks", |
|
1043 |
null, |
|
1044 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
1045 |
); |
|
1046 |
dialog.addActionListener(new ActionListener() { |
|
1047 |
@Override |
|
1048 |
public void actionPerformed(ActionEvent e) { |
|
1049 |
if( dialog.getAction()!=WindowManager_v2.BUTTON_OK ) { |
|
1050 |
return; |
|
1051 |
} |
|
1052 |
Bookmark bookmark = panel.getCurrentBookmark(); |
|
1053 |
if( bookmark!=null ) { |
|
1054 |
setExpression(bookmark.getValue()); |
|
1055 |
} |
|
1056 |
} |
|
1057 |
}); |
|
1058 |
dialog.show(WindowManager.MODE.DIALOG); |
|
1059 |
} |
|
904 | 1060 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultHistoryPanel.java | ||
---|---|---|
1 |
package org.gvsig.expressionevaluator.swing.impl; |
|
2 |
|
|
3 |
import java.awt.Dimension; |
|
4 |
import javax.swing.DefaultListModel; |
|
5 |
import javax.swing.event.ListSelectionEvent; |
|
6 |
import javax.swing.event.ListSelectionListener; |
|
7 |
import org.apache.commons.lang3.StringUtils; |
|
8 |
import org.gvsig.expressionevaluator.Expression; |
|
9 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator; |
|
10 |
import org.gvsig.expressionevaluator.History; |
|
11 |
import org.gvsig.tools.util.LabeledValue; |
|
12 |
import org.gvsig.tools.util.LabeledValueImpl; |
|
13 |
|
|
14 |
/** |
|
15 |
* |
|
16 |
* @author jjdelcerro |
|
17 |
*/ |
|
18 |
public class DefaultHistoryPanel |
|
19 |
extends DefaultHistoryPanelView |
|
20 |
{ |
|
21 |
|
|
22 |
private Expression currentExpression; |
|
23 |
|
|
24 |
public DefaultHistoryPanel() { |
|
25 |
this.initComponents(); |
|
26 |
} |
|
27 |
|
|
28 |
private void initComponents() { |
|
29 |
History history = ExpressionEvaluatorLocator.getManager().getHistory(); |
|
30 |
DefaultListModel<LabeledValue<Expression>> model = new DefaultListModel<>(); |
|
31 |
for (Expression expression : history) { |
|
32 |
model.addElement(new LabeledValueImpl<>( |
|
33 |
StringUtils.abbreviate(expression.getPhrase(), 45), |
|
34 |
expression |
|
35 |
) |
|
36 |
); |
|
37 |
} |
|
38 |
this.currentExpression = null; |
|
39 |
this.lstHistory.setModel(model); |
|
40 |
this.lstHistory.addListSelectionListener(new ListSelectionListener() { |
|
41 |
@Override |
|
42 |
public void valueChanged(ListSelectionEvent e) { |
|
43 |
if( e.getValueIsAdjusting()) { |
|
44 |
return; |
|
45 |
} |
|
46 |
LabeledValue<Expression> value = (LabeledValue<Expression>) lstHistory.getSelectedValue(); |
|
47 |
if( value == null ) { |
|
48 |
return; |
|
49 |
} |
|
50 |
currentExpression = value.getValue(); |
|
51 |
txtFormula.setText(currentExpression.getPhrase()); |
|
52 |
txtFormula.setCaretPosition(0); |
|
53 |
} |
|
54 |
}); |
|
55 |
this.setPreferredSize(new Dimension(400, 300)); |
|
56 |
} |
|
57 |
|
|
58 |
public Expression getExpression() { |
|
59 |
return this.currentExpression; |
|
60 |
} |
|
61 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultBookmarksPanelView.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/jjdelcerro/datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultBookmarksPanelView.xml</at> |
|
28 |
<at name="path">datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultBookmarksPanelView.xml</at> |
|
29 |
<at name="rowspecs">CENTER:2DLU:NONE,FILL:DEFAULT:GROW(0.7),CENTER:2DLU:NONE,FILL:DEFAULT:GROW(0.3),CENTER:2DLU:NONE</at> |
|
30 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE</at> |
|
31 |
<at name="components"> |
|
32 |
<object classname="java.util.LinkedList"> |
|
33 |
<item > |
|
34 |
<at name="value"> |
|
35 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
36 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
37 |
<at name="cellconstraints"> |
|
38 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
39 |
<at name="column">2</at> |
|
40 |
<at name="row">2</at> |
|
41 |
<at name="colspan">3</at> |
|
42 |
<at name="rowspan">1</at> |
|
43 |
<at name="halign">default</at> |
|
44 |
<at name="valign">default</at> |
|
45 |
<at name="insets" object="insets">0,0,0,0</at> |
|
46 |
</object> |
|
47 |
</at> |
|
48 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
49 |
</super> |
|
50 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
51 |
<at name="beanclass">javax.swing.JList</at> |
|
52 |
<at name="beanproperties"> |
|
53 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
54 |
<at name="classname">javax.swing.JList</at> |
|
55 |
<at name="properties"> |
|
56 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
57 |
<at name="border"> |
|
58 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
59 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
60 |
<at name="name">border</at> |
|
61 |
</super> |
|
62 |
<at name="borders"> |
|
63 |
<object classname="java.util.LinkedList"> |
|
64 |
<item > |
|
65 |
<at name="value"> |
|
66 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
67 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
68 |
<at name="name">border</at> |
|
69 |
</super> |
|
70 |
</object> |
|
71 |
</at> |
|
72 |
</item> |
|
73 |
</object> |
|
74 |
</at> |
|
75 |
</object> |
|
76 |
</at> |
|
77 |
<at name="scrollableTracksViewportHeight">true</at> |
|
78 |
<at name="scrollableTracksViewportWidth">true</at> |
|
79 |
<at name="name">lstBookmarks</at> |
|
80 |
<at name="width">927</at> |
|
81 |
<at name="items"> |
|
82 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
83 |
<at name="name">items</at> |
|
84 |
</object> |
|
85 |
</at> |
|
86 |
<at name="scollBars"> |
|
87 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
88 |
<at name="name">scollBars</at> |
|
89 |
<at name="verticalpolicy">20</at> |
|
90 |
<at name="horizontalpolicy">30</at> |
|
91 |
<at name="border"> |
|
92 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
93 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
94 |
<at name="name">border</at> |
|
95 |
</super> |
|
96 |
<at name="borders"> |
|
97 |
<object classname="java.util.LinkedList"> |
|
98 |
<item > |
|
99 |
<at name="value"> |
|
100 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
101 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
102 |
<at name="name">border</at> |
|
103 |
</super> |
|
104 |
</object> |
|
105 |
</at> |
|
106 |
</item> |
|
107 |
</object> |
|
108 |
</at> |
|
109 |
</object> |
|
110 |
</at> |
|
111 |
</object> |
|
112 |
</at> |
|
113 |
<at name="height">261</at> |
|
114 |
</object> |
|
115 |
</at> |
|
116 |
</object> |
|
117 |
</at> |
|
118 |
</object> |
|
119 |
</at> |
|
120 |
</item> |
|
121 |
<item > |
|
122 |
<at name="value"> |
|
123 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
124 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
125 |
<at name="cellconstraints"> |
|
126 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
127 |
<at name="column">2</at> |
|
128 |
<at name="row">4</at> |
|
129 |
<at name="colspan">1</at> |
|
130 |
<at name="rowspan">1</at> |
|
131 |
<at name="halign">default</at> |
|
132 |
<at name="valign">default</at> |
|
133 |
<at name="insets" object="insets">0,0,0,0</at> |
|
134 |
</object> |
|
135 |
</at> |
|
136 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
137 |
</super> |
|
138 |
<at name="id">embedded.1642180118</at> |
|
139 |
<at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:GROW(1.0)</at> |
|
140 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0)</at> |
|
141 |
<at name="components"> |
|
142 |
<object classname="java.util.LinkedList"> |
|
143 |
<item > |
|
144 |
<at name="value"> |
|
145 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
146 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
147 |
<at name="cellconstraints"> |
|
148 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
149 |
<at name="column">1</at> |
|
150 |
<at name="row">1</at> |
|
151 |
<at name="colspan">1</at> |
|
152 |
<at name="rowspan">1</at> |
|
153 |
<at name="halign">default</at> |
|
154 |
<at name="valign">default</at> |
|
155 |
<at name="insets" object="insets">0,0,0,0</at> |
|
156 |
</object> |
|
157 |
</at> |
|
158 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
159 |
</super> |
|
160 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
161 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
162 |
<at name="beanproperties"> |
|
163 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
164 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
165 |
<at name="properties"> |
|
166 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
167 |
<at name="border"> |
|
168 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
169 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
170 |
<at name="name">border</at> |
|
171 |
</super> |
|
172 |
<at name="borders"> |
|
173 |
<object classname="java.util.LinkedList"> |
|
174 |
<item > |
|
175 |
<at name="value"> |
|
176 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
177 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
178 |
<at name="name">border</at> |
|
179 |
</super> |
|
180 |
</object> |
|
181 |
</at> |
|
182 |
</item> |
|
183 |
</object> |
|
184 |
</at> |
|
185 |
</object> |
|
186 |
</at> |
|
187 |
<at name="name">lblName</at> |
|
188 |
<at name="width">69</at> |
|
189 |
<at name="text">_Name</at> |
|
190 |
<at name="fill"> |
|
191 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
192 |
<at name="name">fill</at> |
|
193 |
</object> |
|
194 |
</at> |
|
195 |
<at name="height">14</at> |
|
196 |
</object> |
|
197 |
</at> |
|
198 |
</object> |
|
199 |
</at> |
|
200 |
</object> |
|
201 |
</at> |
|
202 |
</item> |
|
203 |
<item > |
|
204 |
<at name="value"> |
|
205 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
206 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
207 |
<at name="cellconstraints"> |
|
208 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
209 |
<at name="column">1</at> |
|
210 |
<at name="row">3</at> |
|
211 |
<at name="colspan">1</at> |
|
212 |
<at name="rowspan">1</at> |
|
213 |
<at name="halign">default</at> |
|
214 |
<at name="valign">default</at> |
|
215 |
<at name="insets" object="insets">0,0,0,0</at> |
|
216 |
</object> |
|
217 |
</at> |
|
218 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
219 |
</super> |
|
220 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
221 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
222 |
<at name="beanproperties"> |
|
223 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
224 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
225 |
<at name="properties"> |
|
226 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
227 |
<at name="border"> |
|
228 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
229 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
230 |
<at name="name">border</at> |
|
231 |
</super> |
|
232 |
<at name="borders"> |
|
233 |
<object classname="java.util.LinkedList"> |
|
234 |
<item > |
|
235 |
<at name="value"> |
|
236 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
237 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
238 |
<at name="name">border</at> |
|
239 |
</super> |
|
240 |
</object> |
|
241 |
</at> |
|
242 |
</item> |
|
243 |
</object> |
|
244 |
</at> |
|
245 |
</object> |
|
246 |
</at> |
|
247 |
<at name="name">lblLastUse</at> |
|
248 |
<at name="width">69</at> |
|
249 |
<at name="text">_last_use</at> |
|
250 |
<at name="fill"> |
|
251 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
252 |
<at name="name">fill</at> |
|
253 |
</object> |
|
254 |
</at> |
|
255 |
<at name="height">14</at> |
|
256 |
</object> |
|
257 |
</at> |
|
258 |
</object> |
|
259 |
</at> |
|
260 |
</object> |
|
261 |
</at> |
|
262 |
</item> |
|
263 |
<item > |
|
264 |
<at name="value"> |
|
265 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
266 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
267 |
<at name="cellconstraints"> |
|
268 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
269 |
<at name="column">1</at> |
|
270 |
<at name="row">5</at> |
|
271 |
<at name="colspan">1</at> |
|
272 |
<at name="rowspan">1</at> |
|
273 |
<at name="halign">default</at> |
|
274 |
<at name="valign">default</at> |
|
275 |
<at name="insets" object="insets">0,0,0,0</at> |
|
276 |
</object> |
|
277 |
</at> |
|
278 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
279 |
</super> |
|
280 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
281 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
282 |
<at name="beanproperties"> |
|
283 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
284 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
285 |
<at name="properties"> |
|
286 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
287 |
<at name="border"> |
|
288 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
289 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
290 |
<at name="name">border</at> |
|
291 |
</super> |
|
292 |
<at name="borders"> |
|
293 |
<object classname="java.util.LinkedList"> |
|
294 |
<item > |
|
295 |
<at name="value"> |
|
296 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
297 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
298 |
<at name="name">border</at> |
|
299 |
</super> |
|
300 |
</object> |
|
301 |
</at> |
|
302 |
</item> |
|
303 |
</object> |
|
304 |
</at> |
|
305 |
</object> |
|
306 |
</at> |
|
307 |
<at name="name">lblExpression</at> |
|
308 |
<at name="width">69</at> |
|
309 |
<at name="text">_Expression</at> |
|
310 |
<at name="fill"> |
|
311 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
312 |
<at name="name">fill</at> |
|
313 |
</object> |
|
314 |
</at> |
|
315 |
<at name="height">14</at> |
|
316 |
</object> |
|
317 |
</at> |
|
318 |
</object> |
|
319 |
</at> |
|
320 |
</object> |
|
321 |
</at> |
|
322 |
</item> |
|
323 |
<item > |
|
324 |
<at name="value"> |
|
325 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
326 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
327 |
<at name="cellconstraints"> |
|
328 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
329 |
<at name="column">1</at> |
|
330 |
<at name="row">7</at> |
|
331 |
<at name="colspan">3</at> |
|
332 |
<at name="rowspan">1</at> |
|
333 |
<at name="halign">default</at> |
|
334 |
<at name="valign">fill</at> |
|
335 |
<at name="insets" object="insets">0,0,0,0</at> |
|
336 |
</object> |
|
337 |
</at> |
|
338 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
339 |
</super> |
|
340 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
341 |
<at name="beanclass">javax.swing.JTextArea</at> |
|
342 |
<at name="beanproperties"> |
|
343 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
344 |
<at name="classname">javax.swing.JTextArea</at> |
|
345 |
<at name="properties"> |
|
346 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
347 |
<at name="border"> |
|
348 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
349 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
350 |
<at name="name">border</at> |
|
351 |
</super> |
|
352 |
<at name="borders"> |
|
353 |
<object classname="java.util.LinkedList"> |
|
354 |
<item > |
|
355 |
<at name="value"> |
|
356 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
357 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
358 |
<at name="name">border</at> |
|
359 |
</super> |
|
360 |
</object> |
|
361 |
</at> |
|
362 |
</item> |
|
363 |
</object> |
|
364 |
</at> |
|
365 |
</object> |
|
366 |
</at> |
|
367 |
<at name="scrollableTracksViewportHeight">true</at> |
|
368 |
<at name="scrollableTracksViewportWidth">true</at> |
|
369 |
<at name="name">txtExpression</at> |
|
370 |
<at name="width">831</at> |
|
371 |
<at name="scollBars"> |
|
372 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
373 |
<at name="name">scollBars</at> |
|
374 |
<at name="verticalpolicy">20</at> |
|
375 |
<at name="horizontalpolicy">30</at> |
|
376 |
<at name="border"> |
|
377 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
378 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
379 |
<at name="name">border</at> |
|
380 |
</super> |
|
381 |
<at name="borders"> |
|
382 |
<object classname="java.util.LinkedList"> |
|
383 |
<item > |
|
384 |
<at name="value"> |
|
385 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
386 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
387 |
<at name="name">border</at> |
|
388 |
</super> |
|
389 |
</object> |
|
390 |
</at> |
|
391 |
</item> |
|
392 |
</object> |
|
393 |
</at> |
|
394 |
</object> |
|
395 |
</at> |
|
396 |
</object> |
|
397 |
</at> |
|
398 |
<at name="height">156</at> |
|
399 |
</object> |
|
400 |
</at> |
|
401 |
</object> |
|
402 |
</at> |
|
403 |
</object> |
|
404 |
</at> |
|
405 |
</item> |
|
406 |
<item > |
|
407 |
<at name="value"> |
|
408 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
409 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
410 |
<at name="cellconstraints"> |
|
411 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
412 |
<at name="column">3</at> |
|
413 |
<at name="row">1</at> |
|
414 |
<at name="colspan">1</at> |
|
415 |
<at name="rowspan">1</at> |
|
416 |
<at name="halign">default</at> |
|
417 |
<at name="valign">default</at> |
|
418 |
<at name="insets" object="insets">0,0,0,0</at> |
|
419 |
</object> |
|
420 |
</at> |
|
421 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
422 |
</super> |
|
423 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
424 |
<at name="beanclass">javax.swing.JTextField</at> |
|
425 |
<at name="beanproperties"> |
|
426 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
427 |
<at name="classname">javax.swing.JTextField</at> |
|
428 |
<at name="properties"> |
|
429 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
430 |
<at name="border"> |
|
431 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
432 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
433 |
<at name="name">border</at> |
|
434 |
</super> |
|
435 |
<at name="borders"> |
|
436 |
<object classname="java.util.LinkedList"> |
|
437 |
<item > |
|
438 |
<at name="value"> |
|
439 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
440 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
441 |
<at name="name">border</at> |
|
442 |
</super> |
|
443 |
</object> |
|
444 |
</at> |
|
445 |
</item> |
|
446 |
</object> |
|
447 |
</at> |
|
448 |
</object> |
|
449 |
</at> |
|
450 |
<at name="name">txtName</at> |
|
451 |
<at name="width">753</at> |
|
452 |
<at name="height">20</at> |
|
453 |
</object> |
|
454 |
</at> |
|
455 |
</object> |
|
456 |
</at> |
|
457 |
</object> |
|
458 |
</at> |
|
459 |
</item> |
|
460 |
<item > |
|
461 |
<at name="value"> |
|
462 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
463 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
464 |
<at name="cellconstraints"> |
|
465 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
466 |
<at name="column">3</at> |
|
467 |
<at name="row">3</at> |
|
468 |
<at name="colspan">1</at> |
|
469 |
<at name="rowspan">1</at> |
|
470 |
<at name="halign">default</at> |
|
471 |
<at name="valign">default</at> |
Also available in: Unified diff