/** * Create and set the graphic within the state machine. The GraphicAttributes describe the type of * poly to create. */ public void createGraphic(GraphicAttributes ga) { init(); stateMachine.setUndefined(); int renderType = OMGraphic.RENDERTYPE_LATLON; int lineType = OMGraphic.LINETYPE_GREATCIRCLE; if (ga != null) { renderType = ga.getRenderType(); lineType = ga.getLineType(); } if (Debug.debugging("eomg")) { Debug.output("EditableOMDistance.createGraphic(): rendertype = " + renderType); } if (lineType == OMGraphic.LINETYPE_UNKNOWN) { lineType = OMGraphic.LINETYPE_GREATCIRCLE; ga.setLineType(OMGraphic.LINETYPE_GREATCIRCLE); } this.poly = (OMDistance) createGraphic(renderType, lineType); if (ga != null) { ga.setRenderType(poly.getRenderType()); ga.setTo(poly, true); } }
/** * If this EditableOMGraphic has parameters that can be manipulated that are independent of other * EditableOMGraphic types, then you can provide the widgets to control those parameters here. By * default, returns the GraphicAttributes GUI widgets. If you don't want a GUI to appear when a * widget is being created/edited, then don't call this method from the EditableOMGraphic * implementation, and return a null Component from getGUI. * * @param graphicAttributes the GraphicAttributes to use to get the GUI widget from to control * those parameters for this EOMG. * @return Component to use to control parameters for this EOMG. */ public Component getGUI(GraphicAttributes graphicAttributes) { if (graphicAttributes != null) { graphicAttributes.setLineMenuAdditions(null); return graphicAttributes.getGUI(); } return null; }
/** * Adds widgets to modify polygon. * * @param graphicAttributes the GraphicAttributes to use to get the GUI widget from to control * those parameters for this EOMG. * @return Component to use to control parameters for this EOMG. */ public Component getGUI(GraphicAttributes graphicAttributes) { Debug.message("eomg", "EditableOMPoly.getGUI"); if (graphicAttributes != null) { JMenu ahm = getArrowHeadMenu(); graphicAttributes.setLineMenuAdditions(new JMenu[] {ahm}); // JComponent gaGUI = (JComponent) graphicAttributes.getGUI(); JComponent toolbar = createAttributePanel(graphicAttributes); getPolyGUI(graphicAttributes.getOrientation(), toolbar); return toolbar; } else { return getPolyGUI(); } }