From: <sh...@us...> - 2009-02-05 16:04:04
|
Revision: 14072 http://cdk.svn.sourceforge.net/cdk/?rev=14072&view=rev Author: shk3 Date: 2009-02-05 16:04:00 +0000 (Thu, 05 Feb 2009) Log Message: ----------- added zoomfactor to status bar Modified Paths: -------------- jchempaint/trunk/src/main/org/openscience/jchempaint/JCPStatusBar.java jchempaint/trunk/src/main/org/openscience/jchempaint/JChemPaintPanel.java jchempaint/trunk/src/main/org/openscience/jchempaint/RenderPanel.java Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/JCPStatusBar.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/JCPStatusBar.java 2009-02-05 15:20:49 UTC (rev 14071) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/JCPStatusBar.java 2009-02-05 16:04:00 UTC (rev 14072) @@ -43,7 +43,7 @@ { private static final long serialVersionUID = 7075275608248231843L; - JLabel[] status = new JLabel[3]; + JLabel[] status = new JLabel[4]; /** @@ -53,9 +53,9 @@ { super(); - setLayout(new GridLayout(1, 3)); + setLayout(new GridLayout(1, 4)); setPreferredSize(new Dimension(660, 30)); - for (int i = 0; i <= 2; i++) + for (int i = 0; i <= 3; i++) { status[i] = new JLabel(); status[i].setPreferredSize(new Dimension(220, 30)); Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/JChemPaintPanel.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/JChemPaintPanel.java 2009-02-05 15:20:49 UTC (rev 14071) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/JChemPaintPanel.java 2009-02-05 16:04:00 UTC (rev 14072) @@ -495,7 +495,7 @@ public void updateStatusBar(){ if(showStatusBar){ if (this.getChemModel() != null) { - for (int i = 0; i < 3; i++) { + for (int i = 0; i < 4; i++) { String status = renderPanel.getStatus(i); statusBar.setStatus(i + 1, status); } Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/RenderPanel.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/RenderPanel.java 2009-02-05 15:20:49 UTC (rev 14071) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/RenderPanel.java 2009-02-05 16:04:00 UTC (rev 14072) @@ -36,6 +36,7 @@ import java.awt.Image; import java.awt.Rectangle; import java.awt.RenderingHints; +import java.text.NumberFormat; import java.util.Iterator; import javax.swing.JPanel; @@ -52,8 +53,8 @@ import org.openscience.cdk.renderer.Renderer; import org.openscience.cdk.renderer.font.AWTFontManager; import org.openscience.cdk.renderer.selection.ISelection; +import org.openscience.cdk.renderer.visitor.AWTDrawVisitor; import org.openscience.cdk.renderer.visitor.SVGGenerator; -import org.openscience.cdk.renderer.visitor.AWTDrawVisitor; import org.openscience.cdk.tools.manipulator.AtomContainerManipulator; import org.openscience.cdk.tools.manipulator.ChemModelManipulator; import org.openscience.cdk.tools.manipulator.MolecularFormulaManipulator; @@ -302,6 +303,8 @@ status = makeStatusBarString(formula, implicitHs, AtomContainerManipulator.getNaturalExactMass(ac)); } } + } else if (position == 3) { + status= GT._("Zoomfactor")+": "+NumberFormat.getPercentInstance().format(renderer.getZoom()); } return status; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |