Examples of BasicStroke


Examples of java.awt.BasicStroke

                int endcap = ois.readInt();
                int linejoin = ois.readInt();
                float miterlimit = ois.readFloat();
                float dasharray[] = (float[]) ois.readObject();
                float dashphase = ois.readFloat();
                stroke = new BasicStroke(linewidth, endcap, linejoin, miterlimit, dasharray, dashphase);
            } else {
                stroke = (Stroke) ois.readObject();
            }
        } else {
            stroke = OMGraphic.BASIC_STROKE;
View Full Code Here

Examples of java.awt.BasicStroke

        if (paint == null)
            paint = Color.black;

        DrawingAttributes da = new DrawingAttributes();
        da.setLinePaint(paint);
        da.setStroke(new BasicStroke(2));
        if (fill) {
            da.setFillPaint(paint);
        }

        OpenMapAppPartCollection collection = OpenMapAppPartCollection.getInstance();
        IconPartList parts = new IconPartList();

        if (paint instanceof Color || paint == OMColor.clear) {
            Color color = (Color) paint;
            Color opaqueColor = new Color(color.getRed(), color.getGreen(), color.getBlue());
            DrawingAttributes opaqueDA = new DrawingAttributes();
            opaqueDA.setLinePaint(opaqueColor);
            opaqueDA.setStroke(new BasicStroke(2));

            if (fill) {
                opaqueDA.setFillPaint(opaqueColor);
            }
View Full Code Here

Examples of java.awt.BasicStroke

                    if (matted || !isLineClear || !edgeMatchesFill) {

                        if (matted) {
                            if (g instanceof Graphics2D
                                    && stroke instanceof BasicStroke) {
                                ((Graphics2D) g).setStroke(new BasicStroke(((BasicStroke) stroke).getLineWidth() + 2f));
                                setGraphicsColor(g, mattingPaint);
                                g.drawPolyline(_x, _y, _x.length);
                            }
                        }

                        setGraphicsForEdge(g);
                        // for some reason, this used to be
                        // drawPolygon
                        g.drawPolygon(_x, _y, _x.length);
                    }
                }

                // render polyline
                else {

                    if (matted) {
                        if (g instanceof Graphics2D
                                && stroke instanceof BasicStroke) {
                            ((Graphics2D) g).setStroke(new BasicStroke(((BasicStroke) stroke).getLineWidth() + 2f));
                            // Just to draw the matting for the
                            // arrowhead.
                            if (arrowhead != null) {
                                setGraphicsColor(g, mattingPaint);
                                arrowhead.render(g);
View Full Code Here

Examples of java.awt.BasicStroke

     */
    public void setStroke(Stroke s) {
        if (s != null) {
            stroke = s;
        } else {
            stroke = new BasicStroke();
        }
    }
View Full Code Here

Examples of java.awt.BasicStroke

        Shape shp = getShape();
        if (shp != null) {

            if (matted) {
                if (gr instanceof Graphics2D && stroke instanceof BasicStroke) {
                    ((Graphics2D) gr).setStroke(new BasicStroke(((BasicStroke) stroke).getLineWidth() + 2f));
                    setGraphicsColor(gr, mattingPaint);
                    draw(gr);
                }
            }
View Full Code Here

Examples of java.awt.BasicStroke

    }

    protected void renderGeometry(OMGeometry geometry, Graphics gr) {
        if (matted) {
            if (gr instanceof Graphics2D && stroke instanceof BasicStroke) {
                ((Graphics2D) gr).setStroke(new BasicStroke(((BasicStroke) stroke).getLineWidth() + 2f));
                setGraphicsColor(gr, mattingPaint);
                geometry.draw(gr);
            }
        }
View Full Code Here

Examples of java.awt.BasicStroke

     */
    private void processPenWord(StringTokenizer st, OMGraphic omg) {
        if (omg == null)
            return;
        int width = Integer.parseInt(st.nextToken());
        omg.setStroke(new BasicStroke(width));
        /* int pattern = */Integer.parseInt(st.nextToken());
        Color col = convertColor(Integer.parseInt(st.nextToken()));
        omg.setLinePaint(col);
    }
View Full Code Here

Examples of java.awt.BasicStroke

        int len = vals.size();
        OMGraphic omg = null;
        for (int i = 0; i < len; i++) {
            omg = (OMGraphic) vals.elementAt(i);
            omg.setLinePaint(col);
            omg.setStroke(new BasicStroke(width));
        }
    }
View Full Code Here

Examples of java.awt.BasicStroke

                Geo g3 = new Geo(ll2[0], ll2[1]);
                Geo g4 = new Geo(ll2[2], ll2[3]);

                OMLine line2 = new OMLine((float) ogc.getLatitude(), (float) ogc.getLongitude(), (float) gc.getLatitude(), (float) gc.getLongitude(), OMGraphic.LINETYPE_GREATCIRCLE);
                line2.setLinePaint(line.getLinePaint());
                line2.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0f, new float[] {
                        10, 10 }, 0f));
                line2.addArrowHead(true);
                list.add(line2);

                Geo i = gc.crossNormalize(ogc);
View Full Code Here

Examples of java.awt.BasicStroke

            }
           
            int descDir = -1; // this description direction

            ButtonGroup group = new ButtonGroup();
            ImageIcon ii = createArrowIcon(new BasicStroke(1), 50, 20, descDir);
            JRadioButtonMenuItem button = new JRadioButtonMenuItem(ii, !doArrowHead);
            button.setActionCommand(String.valueOf(descDir));
            group.add(button);
            button.addActionListener(listener);
            arrowheadMenu.add(button);

            for (descDir = OMArrowHead.ARROWHEAD_DIRECTION_FORWARD; descDir <= OMArrowHead.ARROWHEAD_DIRECTION_BOTH; descDir++) {
                ii = createArrowIcon(new BasicStroke(1), 50, 20, descDir);
                button = new JRadioButtonMenuItem(ii, doArrowHead
                        && currentDirection == descDir);
                button.setActionCommand(String.valueOf(descDir));
                group.add(button);
                button.addActionListener(listener);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.