You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by tk...@apache.org on 2001/05/04 19:04:45 UTC
cvs commit: xml-batik/sources/org/apache/batik/util/gui ExtendedGridBagConstraints.java
tkormann 01/05/04 10:04:43
Modified: resources/org/apache/batik/apps/svgbrowser/resources
GUI.properties
sources/org/apache/batik/apps/svgbrowser
JSVGViewerFrame.java
sources/org/apache/batik/bridge BridgeContext.java
sources/org/apache/batik/swing/gvt JGVTComponent.java
sources/org/apache/batik/transcoder TranscoderException.java
sources/org/apache/batik/util/gui
ExtendedGridBagConstraints.java
Added: resources/org/apache/batik/apps/svgbrowser/resources
FindDialog.properties
sources/org/apache/batik/apps/svgbrowser FindDialog.java
Log:
First shot of the Find dialog.
The behavior when a text is found has to be improved... next week...
Revision Changes Path
1.16 +2 -3 xml-batik/resources/org/apache/batik/apps/svgbrowser/resources/GUI.properties
Index: GUI.properties
===================================================================
RCS file: /home/cvs/xml-batik/resources/org/apache/batik/apps/svgbrowser/resources/GUI.properties,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- GUI.properties 2001/05/04 00:56:36 1.15
+++ GUI.properties 2001/05/04 17:04:07 1.16
@@ -9,7 +9,7 @@
# The viewer's GUI resources.
#
# Author: stephane@hillion.org
-# $Id: GUI.properties,v 1.15 2001/05/04 00:56:36 vhardy Exp $
+# $Id: GUI.properties,v 1.16 2001/05/04 17:04:07 tkormann Exp $
#
ViewSource.width = 750
@@ -36,7 +36,6 @@
#
ExportAsPNG.title = Export as PNG
ExportAsJPG.title = Export as JPG
-FindDialog.title = Find...
SetTransform.title = Set Transform
#
@@ -264,7 +263,7 @@
ShowDebug.selected = false
# Tools menu ################
-Tools = Monitor DOMViewer
+Tools = Monitor DOMViewer FindDialog
Tools.type = MENU
Tools.text = Tools
Tools.mnemonic = T
1.1 xml-batik/resources/org/apache/batik/apps/svgbrowser/resources/FindDialog.properties
Index: FindDialog.properties
===================================================================
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# FindDialog properties file
#
# Author: tkormann@apache.org
# $Id: FindDialog.properties,v 1.1 2001/05/04 17:04:06 tkormann Exp $
#
Dialog.title = Find...
Panel.title = Search for text
FindLabel.text = Find :
CaseSensitiveCheckBox.text = Case sensitive
CaseSensitiveCheckBox.mnemonic = S
NextButton.text = Next
NextButton.mnemonic = N
NextButton.action = NextButtonAction
PreviousButton.text = Previous
PreviousButton.mnemonic = P
PreviousButton.action = PreviousButtonAction
CloseButton.text = Close
CloseButton.mnemonic = C
CloseButton.action = CloseButtonAction
1.32 +37 -2 xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
Index: JSVGViewerFrame.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- JSVGViewerFrame.java 2001/05/04 01:12:42 1.31
+++ JSVGViewerFrame.java 2001/05/04 17:04:18 1.32
@@ -131,7 +131,7 @@
* This class represents a SVG viewer swing frame.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
- * @version $Id: JSVGViewerFrame.java,v 1.31 2001/05/04 01:12:42 vhardy Exp $
+ * @version $Id: JSVGViewerFrame.java,v 1.32 2001/05/04 17:04:18 tkormann Exp $
*/
public class JSVGViewerFrame
extends JFrame
@@ -174,6 +174,7 @@
public final static String MONITOR_ACTION = "MonitorAction";
public final static String DOM_VIEWER_ACTION = "DOMViewerAction";
public final static String SET_TRANSFORM_ACTION = "SetTransformAction";
+ public final static String FIND_DIALOG_ACTION = "FindDialogAction";
/**
* The cursor indicating that an operation is pending.
@@ -289,6 +290,11 @@
protected LanguageDialog languageDialog;
/**
+ * The Find dialog.
+ */
+ protected FindDialog findDialog;
+
+ /**
* The transform dialog
*/
protected JAffineTransformChooser.Dialog transformDialog;
@@ -382,6 +388,7 @@
listeners.put(MONITOR_ACTION, new MonitorAction());
listeners.put(DOM_VIEWER_ACTION, new DOMViewerAction());
listeners.put(SET_TRANSFORM_ACTION, new SetTransformAction());
+ listeners.put(FIND_DIALOG_ACTION, new FindDialogAction());
svgCanvas = new JSVGCanvas(userAgent, true, true);
@@ -1210,7 +1217,7 @@
public SetTransformAction(){}
public void actionPerformed(ActionEvent e){
if (transformDialog == null){
- transformDialog
+ transformDialog
= JAffineTransformChooser.createDialog
(JSVGViewerFrame.this,
resources.getString("SetTransform.title"),
@@ -1289,6 +1296,26 @@
}
/**
+ * To display the Find dialog
+ */
+ public class FindDialogAction extends AbstractAction {
+ public FindDialogAction() {}
+ public void actionPerformed(ActionEvent e) {
+ if (findDialog == null) {
+ findDialog = new FindDialog(JSVGViewerFrame.this, svgCanvas);
+ findDialog.setGraphicsNode(svgCanvas.getGraphicsNode());
+ findDialog.pack();
+ Rectangle fr = getBounds();
+ Dimension td = findDialog.getSize();
+ findDialog.setLocation(fr.x + (fr.width - td.width) / 2,
+ fr.y + (fr.height - td.height) / 2);
+ }
+ findDialog.pack();
+ findDialog.show();
+ }
+ }
+
+ /**
* To display the DOM viewer of the document
*/
public class DOMViewerAction extends AbstractAction {
@@ -1450,6 +1477,14 @@
if (debug) {
System.out.print("Build completed in ");
System.out.println((System.currentTimeMillis() - time) + " ms");
+ }
+ if (findDialog != null) {
+ if(findDialog.isVisible()) {
+ findDialog.setGraphicsNode(svgCanvas.getGraphicsNode());
+ } else {
+ findDialog.dispose();
+ findDialog = null;
+ }
}
stopAction.update(false);
svgCanvas.setCursor(DEFAULT_CURSOR);
1.1 xml-batik/sources/org/apache/batik/apps/svgbrowser/FindDialog.java
Index: FindDialog.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.apps.svgbrowser;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.event.DocumentListener;
import javax.swing.event.DocumentEvent;
import org.apache.batik.gvt.CompositeGraphicsNode;
import org.apache.batik.gvt.GVTTreeWalker;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.gvt.TextNode;
import org.apache.batik.swing.JSVGCanvas;
import org.apache.batik.util.gui.ExtendedGridBagConstraints;
import org.apache.batik.util.gui.resource.ActionMap;
import org.apache.batik.util.gui.resource.ButtonFactory;
import org.apache.batik.util.gui.resource.MissingListenerException;
import org.apache.batik.util.gui.resource.ResourceManager;
/**
* This class represents a Dialog that lets the user searching for text inside
* an SVG document.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
* @version $Id: FindDialog.java,v 1.1 2001/05/04 17:04:17 tkormann Exp $
*/
public class FindDialog extends JDialog implements ActionMap {
/**
* The resource file name
*/
protected final static String RESOURCES =
"org.apache.batik.apps.svgbrowser.resources.FindDialog";
// action names
public final static String NEXT_ACTION = "NextButtonAction";
public final static String PREVIOUS_ACTION = "PreviousButtonAction";
public final static String CLOSE_ACTION = "CloseButtonAction";
/**
* The resource bundle
*/
protected static ResourceBundle bundle;
/**
* The resource manager
*/
protected static ResourceManager resources;
static {
bundle = ResourceBundle.getBundle(RESOURCES, Locale.getDefault());
resources = new ResourceManager(bundle);
}
/** The button factory */
protected ButtonFactory buttonFactory;
/** The GVT root into which text is searched. */
protected GraphicsNode gvtRoot;
/** The GVTTreeWalker used to scan the GVT Tree. */
protected GVTTreeWalker walker;
/** The TextField that owns the text to search. */
protected JTextField search;
/** The next button. */
protected JButton next;
/** The next button. */
protected JButton previous;
/** The cancel button. */
protected JButton close;
/** The case sensitive button. */
protected JCheckBox caseSensitive;
/** The canvas. */
protected JSVGCanvas svgCanvas;
/**
* Constructs a new <tt>FindDialog</tt>.
*/
public FindDialog(JSVGCanvas svgCanvas) {
this(null, svgCanvas);
}
/**
* Constructs a new <tt>FindDialog</tt>.
*/
public FindDialog(Frame owner, JSVGCanvas svgCanvas) {
super(owner, resources.getString("Dialog.title"));
this.svgCanvas = svgCanvas;
buttonFactory = new ButtonFactory(bundle, this);
listeners.put(NEXT_ACTION, new NextButtonAction());
listeners.put(PREVIOUS_ACTION, new PreviousButtonAction());
listeners.put(CLOSE_ACTION, new CloseButtonAction());
getContentPane().add(createFindPanel(), BorderLayout.CENTER);
getContentPane().add(createButtonsPanel(), BorderLayout.SOUTH);
}
/**
* Creates the Find panel.
*/
protected JPanel createFindPanel() {
JPanel panel = new JPanel(new GridBagLayout());
panel.setBorder(BorderFactory.createTitledBorder
(BorderFactory.createEtchedBorder(),
resources.getString("Panel.title")));
ExtendedGridBagConstraints gbc = new ExtendedGridBagConstraints();
gbc.insets = new Insets(2, 2, 2, 2);
gbc.anchor = ExtendedGridBagConstraints.EAST;
gbc.fill = ExtendedGridBagConstraints.NONE;
gbc.setWeight(0, 0);
gbc.setGridBounds(0, 0, 1, 1);
panel.add(new JLabel(resources.getString("FindLabel.text")), gbc);
gbc.fill = ExtendedGridBagConstraints.HORIZONTAL;
gbc.setWeight(1.0, 0);
gbc.setGridBounds(1, 0, 1, 1);
panel.add(search = new JTextField(20), gbc);
search.getDocument().addDocumentListener(new TextTracker());
gbc.fill = ExtendedGridBagConstraints.NONE;
gbc.anchor = ExtendedGridBagConstraints.WEST;
gbc.setWeight(0, 0);
gbc.setGridBounds(1, 1, 1, 1);
caseSensitive = buttonFactory.createJCheckBox("CaseSensitiveCheckBox");
panel.add(caseSensitive, gbc);
return panel;
}
/**
* Creates the buttons panel
*/
protected JPanel createButtonsPanel() {
JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
panel.add(next = buttonFactory.createJButton("NextButton"));
panel.add(previous = buttonFactory.createJButton("PreviousButton"));
panel.add(close = buttonFactory.createJButton("CloseButton"));
updateButtonState();
return panel;
}
/**
* Sets the graphics node into which text is searched.
* @param gvtRoot the GVT root node
*/
public void setGraphicsNode(GraphicsNode gvtRoot) {
this.gvtRoot = gvtRoot;
if (gvtRoot != null) {
this.walker = new GVTTreeWalker(gvtRoot);
} else {
this.walker = null;
}
updateButtonState();
}
/**
* Returns the next GraphicsNode that matches the specified string or null
* if any.
*
* @param text the text to match
*/
protected GraphicsNode getNext(String text) {
GraphicsNode gn = walker.nextGraphicsNode();
while (gn != null && !match(gn, text)) {
gn = walker.nextGraphicsNode();
}
return gn;
}
/**
* Returns the previous GraphicsNode that matches the specified string or
* null if any.
*
* @param text the text to match
*/
protected GraphicsNode getPrevious(String text) {
GraphicsNode gn = walker.previousGraphicsNode();
while (gn != null && !match(gn, text)) {
gn = walker.previousGraphicsNode();
}
return gn;
}
/**
* Returns true if the specified node matches the following text, false
* otherwise.
*
* @param node the graphics node to check
* @param text the text use to match
*/
protected boolean match(GraphicsNode node, String text) {
if (!(node instanceof TextNode)
|| !node.isVisible()
|| text == null || text.length() == 0) {
return false;
}
String s = ((TextNode)node).getText();
if (!caseSensitive.isSelected()) {
s = s.toLowerCase();
text = text.toLowerCase();
}
return s.startsWith(text);
}
/**
* Updates the state of the 'next', 'previous' buttons and 'search' text
* field.
*/
private void updateButtonState() {
boolean b1 = (gvtRoot != null);
String text = search.getText();
boolean b2 = (text != null && text.length() > 0);
next.setEnabled(b1 && b2);
previous.setEnabled(b1 && b2);
search.setEnabled(b1);
}
/**
* Shows the current selected <tt>TextNode</tt>.
*/
protected void showSelectedGraphicsNode() {
GraphicsNode gn = walker.getCurrentGraphicsNode();
if (!(gn instanceof TextNode)) {
return;
}
Rectangle2D bounds = gn.getBounds(svgCanvas.getRenderContext());
bounds = gn.getGlobalTransform().createTransformedShape
(bounds).getBounds();
Dimension dim = svgCanvas.getSize();
AffineTransform Tx = new AffineTransform();
double s = Math.min(dim.width/bounds.getWidth(),
dim.height/bounds.getHeight());
Tx.scale(s*.8, s*.8);
Tx.translate(-bounds.getX(), -bounds.getY());
svgCanvas.setRenderingTransform(Tx);
//System.out.println(gn+" "+((TextNode)gn).getText()+" "+bounds);
}
// ActionMap implementation
/**
* The map that contains the listeners
*/
protected Map listeners = new HashMap(10);
/**
* Returns the action associated with the given string
* or null on error
* @param key the key mapped with the action to get
* @throws MissingListenerException if the action is not found
*/
public Action getAction(String key) throws MissingListenerException {
return (Action)listeners.get(key);
}
//////////////////////////////////////////////////////////////////////////
// Action implementation
//////////////////////////////////////////////////////////////////////////
/**
* The action associated to the 'next' button.
*/
protected class NextButtonAction extends AbstractAction {
public void actionPerformed(ActionEvent e) {
GraphicsNode gn = getNext(search.getText());
if (gn != null) {
previous.setEnabled(true);
showSelectedGraphicsNode();
} else {
next.setEnabled(false);
}
}
}
/**
* The action associated to the 'previous' button.
*/
protected class PreviousButtonAction extends AbstractAction {
public void actionPerformed(ActionEvent e) {
GraphicsNode gn = getPrevious(search.getText());
if (gn != null) {
next.setEnabled(true);
showSelectedGraphicsNode();
} else {
previous.setEnabled(false);
}
}
}
/**
* The action associated to the 'close' button.
*/
protected class CloseButtonAction extends AbstractAction {
public void actionPerformed(ActionEvent e) {
dispose();
}
}
/**
* This class is used to track all modifications of the search TextField.
*/
protected class TextTracker implements DocumentListener {
public void changedUpdate(DocumentEvent e) { }
public void insertUpdate(DocumentEvent e) {
updateButtonState();
String text = search.getText();
// go to next only if the current node does not match the text
if (!match(walker.getCurrentGraphicsNode(), text)) {
GraphicsNode gn = getNext(text);
if (gn != null) {
previous.setEnabled(true);
showSelectedGraphicsNode();
} else {
next.setEnabled(false);
}
}
}
public void removeUpdate(DocumentEvent e) {
updateButtonState();
GraphicsNode gn = getPrevious(search.getText());
if (gn != null) {
next.setEnabled(true);
showSelectedGraphicsNode();
} else {
previous.setEnabled(false);
}
}
}
}
1.23 +14 -15 xml-batik/sources/org/apache/batik/bridge/BridgeContext.java
Index: BridgeContext.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/BridgeContext.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- BridgeContext.java 2001/05/03 22:10:41 1.22
+++ BridgeContext.java 2001/05/04 17:04:22 1.23
@@ -17,12 +17,14 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.ListIterator;
import java.util.Map;
import org.apache.batik.css.HiddenChildElementSupport;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.gvt.GraphicsNodeRenderContext;
import org.apache.batik.script.InterpreterPool;
+import org.apache.batik.util.Service;
import org.apache.batik.util.SVGConstants;
import org.w3c.dom.Element;
import org.w3c.dom.svg.SVGDocument;
@@ -41,7 +43,7 @@
* a SVG DOM tree such as the current viewport or the user agent.
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
- * @version $Id: BridgeContext.java,v 1.22 2001/05/03 22:10:41 deweese Exp $
+ * @version $Id: BridgeContext.java,v 1.23 2001/05/04 17:04:22 tkormann Exp $
*/
public class BridgeContext implements ErrorConstants {
@@ -835,7 +837,7 @@
}
/**
- * Associates the specified <tt>Bridge</tt> object with it's
+ * Associates the specified <tt>Bridge</tt> object with it's
* namespace URI and local name.
* @param bridge the bridge that manages the element
*/
@@ -846,26 +848,24 @@
}
/**
- * Register Extensions
+ * Registers extensions to the specified <tt>BridgeContext</tt>.
+ *
+ * @param ctx the bridge context to initialize with extensions
*/
public static void registerBridgeExtensions(BridgeContext ctx) {
- java.util.List entries = new java.util.LinkedList();
+
+ List entries = new LinkedList();
+ Iterator iter = Service.providers(BridgeExtension.class);
- java.util.Iterator iter = org.apache.batik.util.Service.providers
- (BridgeExtension.class);
while (iter.hasNext()) {
BridgeExtension be = (BridgeExtension)iter.next();
- // System.out.println("BE: " + be);
float priority = be.getPriority();
-
- java.util.ListIterator li;
- li = entries.listIterator();
- while (true) {
+ ListIterator li = entries.listIterator();
+ for (;;) {
if (!li.hasNext()) {
li.add(be);
break;
}
-
BridgeExtension lbe = (BridgeExtension)li.next();
if (lbe.getPriority() > priority) {
li.previous();
@@ -874,14 +874,13 @@
}
}
}
-
- UserAgent ua = ctx.getUserAgent();
+ UserAgent ua = ctx.getUserAgent();
iter = entries.iterator();
while(iter.hasNext()) {
BridgeExtension be = (BridgeExtension)iter.next();
be.registerTags(ctx);
- java.util.Iterator exts = be.getImplementedExtensions();
+ Iterator exts = be.getImplementedExtensions();
while (exts.hasNext()) {
String ext = (String)exts.next();
// ua.addExtension(ext);
1.13 +10 -1 xml-batik/sources/org/apache/batik/swing/gvt/JGVTComponent.java
Index: JGVTComponent.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/swing/gvt/JGVTComponent.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- JGVTComponent.java 2001/05/04 12:13:43 1.12
+++ JGVTComponent.java 2001/05/04 17:04:27 1.13
@@ -41,6 +41,7 @@
import javax.swing.JComponent;
import org.apache.batik.gvt.GraphicsNode;
+import org.apache.batik.gvt.GraphicsNodeRenderContext;
import org.apache.batik.gvt.event.AWTEventDispatcher;
@@ -52,7 +53,7 @@
* This class represents a component which can display a GVT tree.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
- * @version $Id: JGVTComponent.java,v 1.12 2001/05/04 12:13:43 hillion Exp $
+ * @version $Id: JGVTComponent.java,v 1.13 2001/05/04 17:04:27 tkormann Exp $
*/
public class JGVTComponent extends JComponent {
@@ -208,6 +209,14 @@
}
});
+ }
+
+ /**
+ * Returns the <tt>GraphicsNodeRenderContext</tt> used by the renderer. Use
+ * this object if you want to manipulate the GVT tree.
+ */
+ public GraphicsNodeRenderContext getRenderContext() {
+ return rendererFactory.getRenderContext();
}
/**
1.4 +5 -7 xml-batik/sources/org/apache/batik/transcoder/TranscoderException.java
Index: TranscoderException.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/transcoder/TranscoderException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TranscoderException.java 2001/01/14 21:27:47 1.3
+++ TranscoderException.java 2001/05/04 17:04:33 1.4
@@ -12,7 +12,7 @@
* Thrown when a transcoder is not able to transcode its input.
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
- * @version $Id: TranscoderException.java,v 1.3 2001/01/14 21:27:47 tkormann Exp $
+ * @version $Id: TranscoderException.java,v 1.4 2001/05/04 17:04:33 tkormann Exp $
*/
public class TranscoderException extends Exception {
@@ -52,13 +52,11 @@
*/
public String getMessage() {
String msg = super.getMessage();
- if (msg != null) {
- return msg;
- } else if (ex != null) {
- return ex.getMessage();
- } else {
- return null;
+ if (ex != null) {
+ msg += "\nEnclosed Exception:\n";
+ msg += ex.getMessage();
}
+ return msg;
}
/**
1.2 +18 -5 xml-batik/sources/org/apache/batik/util/gui/ExtendedGridBagConstraints.java
Index: ExtendedGridBagConstraints.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/util/gui/ExtendedGridBagConstraints.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExtendedGridBagConstraints.java 2000/10/10 18:41:56 1.1
+++ ExtendedGridBagConstraints.java 2001/05/04 17:04:39 1.2
@@ -15,20 +15,33 @@
* provide some utility methods.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
- * @version $Id: ExtendedGridBagConstraints.java,v 1.1 2000/10/10 18:41:56 hillion Exp $
+ * @version $Id: ExtendedGridBagConstraints.java,v 1.2 2001/05/04 17:04:39 tkormann Exp $
*/
public class ExtendedGridBagConstraints extends GridBagConstraints {
+
/**
* Modifies gridx, gridy, gridwidth, gridheight.
+ *
* @param x The value for gridx.
* @param y The value for gridy.
* @param width The value for gridwidth.
* @param height The value for gridheight.
*/
public void setGridBounds(int x, int y, int width, int height) {
- gridx = x;
- gridy = y;
- gridwidth = width;
- gridheight = height;
+ gridx = x;
+ gridy = y;
+ gridwidth = width;
+ gridheight = height;
+ }
+
+ /**
+ * Modifies the weightx and weighty.
+ *
+ * @param weightx The value for weightx
+ * @param weighty The value for weighty
+ */
+ public void setWeight(double weightx, double weighty) {
+ this.weightx = weightx;
+ this.weighty = weighty;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org