X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scenegraph%2Fsrc%2Forg%2Fsimantics%2Fscenegraph%2Fg2d%2Fnodes%2FTrend2DNode.java;h=b793df6d058de793f504f4a82eb9c051c4510916;hb=fe29fd8956c3881e261ec4eee1cdd2ac27bc0554;hp=a2c2e5de02ab9766dc17d04da1a82a953f4065bd;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/Trend2DNode.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/Trend2DNode.java index a2c2e5de0..b793df6d0 100644 --- a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/Trend2DNode.java +++ b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/Trend2DNode.java @@ -1,14 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ package org.simantics.scenegraph.g2d.nodes; import java.awt.BasicStroke; @@ -17,7 +17,7 @@ import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.RenderingHints; -import java.awt.geom.AffineTransform; +import java.awt.geom.AffineTransform; import java.awt.geom.GeneralPath; import java.awt.geom.Rectangle2D; import java.io.Serializable; @@ -111,11 +111,11 @@ public class Trend2DNode extends G2DNode { public void render(Graphics2D g2d) { if(points == null || bounds == null) { return; - } - AffineTransform ot = g2d.getTransform(); + } + AffineTransform ot = g2d.getTransform(); g2d.translate(x, y); - @SuppressWarnings("unused") + @SuppressWarnings("unused") int pointsDrawn = 0; double max_y = Double.MIN_VALUE; // for scaling @@ -201,8 +201,8 @@ public class Trend2DNode extends G2DNode { // Print max time NumberFormat tformat = new DecimalFormat("#.0"); String time = tformat.format(max_x); - g2d.drawString(time, (float)(bounds.getMaxX()-fm.getStringBounds(time, g2d).getWidth()/2), (float)(bounds.getMaxY()+fm.getStringBounds(time, g2d).getHeight())); - + g2d.drawString(time, (float)(bounds.getMaxX()-fm.getStringBounds(time, g2d).getWidth()/2), (float)(bounds.getMaxY()+fm.getStringBounds(time, g2d).getHeight())); + g2d.setTransform(ot); }