public void incrFontSize() { textFont.incrFontSize(); };
public void decrFontSize() { textFont.decrFontSize(); };
public void draw(java.awt.Graphics2D g, java.awt.geom.AffineTransform normal2Device) { if ((project == null) || !posWasCalc) return; // use world coordinates for position, but draw in screen coordinates // so that the symbols stay the same size AffineTransform world2Device = g.getTransform(); g.setTransform(normal2Device); // identity transform for screen coords // transform World to Normal coords: // world2Normal = pixelAT-1 * world2Device // cache for pick closest AffineTransform world2Normal; try { world2Normal = normal2Device.createInverse(); world2Normal.concatenate(world2Device); } catch (java.awt.geom.NoninvertibleTransformException e) { System.out.println(" RendSurfObs: NoninvertibleTransformException on " + normal2Device); return; } // we want aliasing; but save previous state to restore at end Object saveHint = g.getRenderingHint(RenderingHints.KEY_ANTIALIASING); // g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, // RenderingHints.VALUE_ANTIALIAS_ON); g.setStroke(new java.awt.BasicStroke(1.0f)); /* set up the grid Rectangle2D bbox = (Rectangle2D) g.getClip(); // clipping area in normal coords // clear the grid = "no stations are drawn" stationGrid.clear(); // set the grid size based on typical bounding box stationGrid.setGrid(bbox, typicalBB.getWidth(), typicalBB.getHeight()); // always draw selected if (selected != null) { selected.calcPos( world2Normal); stationGrid.markIfClear( selected.getBB(), selected); selected.draw(g); } */ g.setFont(textFont.getFont()); g.setColor(color); int count = 0; int npts = obsUIlist.size(); GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD, npts); for (int i = 0; i < npts; i++) { ObservationUI s = (ObservationUI) obsUIlist.get(i); s.calcPos(world2Normal); s.draw(g); if (Double.isNaN(s.screenPos.getX())) { System.out.println("screenPos=" + s.screenPos + " world = " + s.worldPos); continue; } if (count == 0) path.moveTo((float) s.screenPos.getX(), (float) s.screenPos.getY()); else path.lineTo((float) s.screenPos.getX(), (float) s.screenPos.getY()); count++; } g.setColor(color); g.draw(path); // draw selected if (selected != null) selected.draw(g); // restore g.setTransform(world2Device); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, saveHint); }