Package org.gephi.graph.api

Examples of org.gephi.graph.api.Renderable


        public void endRendering() {
            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


                renderer.draw3D(txt, posX, posY, posZ, textData.getSizeFactor());
            }
        }

        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

        public void endRendering() {
            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

                renderer.draw3D(txt, posX, posY, 0, textData.getSizeFactor());
            }
        }

        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

                }
            } else {
                renderer.setColor(text.getR(), text.getG(), text.getB(), text.getAlpha());
            }
        } else {
            Renderable renderable = model.getObj();
            if (vizConfig.isLightenNonSelected()) {
                if (!model.isSelected() && !model.isHighlight()) {
                    float lightColorFactor = 1 - vizConfig.getLightenNonSelectedFactor();
                    renderer.setColor(renderable.r(), renderable.g(), renderable.b(), lightColorFactor);
                } else {
                    renderer.setColor(renderable.r(), renderable.g(), renderable.b(), 1);
                }
            } else {
                renderer.setColor(renderable.r(), renderable.g(), renderable.b(), renderable.alpha());
            }
        }
    }
View Full Code Here

        this.g = g;
        this.b = b;
    }

    public static void layerColor(ModelImpl model, float r, float g, float b) {
        Renderable obj = model.getObj();
        ColorLayer cl = new ColorLayer(obj.r(), obj.g(), obj.b());
        model.setColorLayer(cl);
        obj.setR(r);
        obj.setG(g);
        obj.setB(b);
    }
View Full Code Here

TOP

Related Classes of org.gephi.graph.api.Renderable

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.