Package org.gephi.visualization.impl

Examples of org.gephi.visualization.impl.TextDataImpl


            renderer.end3DRendering();
        }

        public void drawTextNode(ModelImpl objectModel) {
            Renderable renderable = objectModel.getObj();
            TextDataImpl textData = (TextDataImpl) renderable.getTextData();
            if (textData != null) {
                model.colorMode.textColor(this, textData, objectModel);
                model.sizeMode.setSizeFactor3d(model.nodeSizeFactor, textData, objectModel);
                if (nodeRefresh) {
                    builder.buildNodeText((NodeData) renderable, textData, model, currentTimeInterval);
                }
                String txt = textData.getLine().getText();
                Rectangle2D r = renderer.getBounds(txt);
                textData.getLine().setBounds(r);
                float posX = renderable.x() + (float) r.getWidth() / -2 * textData.getSizeFactor();
                float posY = renderable.y() + (float) r.getHeight() / -2 * textData.getSizeFactor();
                float posZ = renderable.getRadius();

                renderer.draw3D(txt, posX, posY, posZ, textData.getSizeFactor());
            }
        }
View Full Code Here


            }
        }

        public void drawTextEdge(ModelImpl objectModel) {
            Renderable renderable = objectModel.getObj();
            TextDataImpl textData = (TextDataImpl) renderable.getTextData();
            if (textData != null) {
                model.colorMode.textColor(this, textData, objectModel);
                model.sizeMode.setSizeFactor3d(model.edgeSizeFactor, textData, objectModel);
                if (edgeRefresh) {
                    builder.buildEdgeText((EdgeData) renderable, textData, model, currentTimeInterval);
                }

                String txt = textData.getLine().getText();
                Rectangle2D r = renderer.getBounds(txt);
                textData.getLine().setBounds(r);
                float posX = renderable.x() + (float) r.getWidth() / -2 * textData.getSizeFactor();
                float posY = renderable.y() + (float) r.getHeight() / -2 * textData.getSizeFactor();
                float posZ = renderable.getRadius();

                renderer.draw3D(txt, posX, posY, posZ, textData.getSizeFactor());
            }
        }
View Full Code Here

            renderer.endRendering();
        }

        public void drawTextNode(ModelImpl objectModel) {
            Renderable renderable = objectModel.getObj();
            TextDataImpl textData = (TextDataImpl) renderable.getTextData();
            if (textData != null) {
                model.colorMode.textColor(this, textData, objectModel);
                model.sizeMode.setSizeFactor2d(model.nodeSizeFactor, textData, objectModel);
                if (nodeRefresh) {
                    builder.buildNodeText((NodeData) renderable, textData, model, currentTimeInterval);
                }
                if (textData.getSizeFactor() * renderer.getCharWidth('a') < PIXEL_LIMIT) {
                    return;
                }
                String txt = textData.getLine().getText();
                Rectangle2D r = renderer.getBounds(txt);
                float posX = renderable.getModel().getViewportX() + (float) r.getWidth() / -2 * textData.getSizeFactor();
                float posY = renderable.getModel().getViewportY() + (float) r.getHeight() / -2 * textData.getSizeFactor();
                r.setRect(0, 0, r.getWidth() / Math.abs(drawable.getDraggingMarkerX()), r.getHeight() / Math.abs(drawable.getDraggingMarkerY()));
                textData.getLine().setBounds(r);

                renderer.draw3D(txt, posX, posY, 0, textData.getSizeFactor());
            }
        }
View Full Code Here

            }
        }

        public void drawTextEdge(ModelImpl objectModel) {
            Renderable renderable = objectModel.getObj();
            TextDataImpl textData = (TextDataImpl) renderable.getTextData();
            if (textData != null) {
                model.colorMode.textColor(this, textData, objectModel);
                model.sizeMode.setSizeFactor2d(model.edgeSizeFactor, textData, objectModel);
                if (edgeRefresh) {
                    builder.buildEdgeText((EdgeData) renderable, textData, model, currentTimeInterval);
                }
                if (textData.getSizeFactor() * renderer.getCharWidth('a') < PIXEL_LIMIT) {
                    return;
                }
                String txt = textData.getLine().getText();
                Rectangle2D r = renderer.getBounds(txt);
                float posX = renderable.getModel().getViewportX() + (float) r.getWidth() / -2 * textData.getSizeFactor();
                float posY = renderable.getModel().getViewportY() + (float) r.getHeight() / -2 * textData.getSizeFactor();
                r.setRect(0, 0, r.getWidth() / drawable.getDraggingMarkerX(), r.getHeight() / drawable.getDraggingMarkerY());
                textData.getLine().setBounds(r);

                renderer.draw3D(txt, posX, posY, 0, textData.getSizeFactor());
            }
        }
View Full Code Here

                    case XMLStreamReader.START_ELEMENT:
                        String name = reader.getLocalName();
                        if (ELEMENT_NODEDATA_TEXTDATA.equalsIgnoreCase(name)) {
                            int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
                            Node node = hierarchicalGraph.getNode(id);
                            TextDataImpl textDataImpl = (TextDataImpl) node.getNodeData().getTextData();
                            readTextData(reader, textDataImpl);
                        } else if (ELEMENT_EDGEDATA_TEXTDATA.equalsIgnoreCase(name)) {
                            int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
                            Edge edge = hierarchicalGraph.getEdge(id);
                            TextDataImpl textDataImpl = (TextDataImpl) edge.getEdgeData().getTextData();
                            readTextData(reader, textDataImpl);
                        }
                        break;
                    case XMLStreamReader.END_ELEMENT:
                        if (ELEMENT_TEXTDATA.equalsIgnoreCase(reader.getLocalName())) {
View Full Code Here

TOP

Related Classes of org.gephi.visualization.impl.TextDataImpl

Copyright © 2018 www.massapicom. 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.