コード例 #1
0
    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());
      }
    }
コード例 #2
0
    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());
      }
    }