Package org.scilab.forge.jlatexmath

Examples of org.scilab.forge.jlatexmath.TeXIcon


        xyzSW[0] = sw1; xyzSW[1] = sw2;  xyzSW[2] = sw3;
       
        latexStr = _latexStr;
       
        TeXFormula formula = new TeXFormula(true, latexStr);
        TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20);
        icon.setInsets(new Insets(5, 5, 5, 5));

        img = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = img.createGraphics();
        g2.setColor(Color.white);
        g2.fillRect(0,0,icon.getIconWidth(),icon.getIconHeight());
        JLabel jl = new JLabel();
        jl.setForeground(new Color(0, 0, 0));
        icon.paintIcon(jl, g2, 0, 0);

        alpha = (float)0.5;
     
}
View Full Code Here


        xcoord = x;
        ycoord = y;
        latexStr = _latexStr;
       
        TeXFormula formula = new TeXFormula(true, latexStr);
        TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20);
        icon.setInsets(new Insets(5, 5, 5, 5));

        img = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = img.createGraphics();
        g2.setColor(Color.white);
        g2.fillRect(0,0,icon.getIconWidth(),icon.getIconHeight());
        JLabel jl = new JLabel();
        jl.setForeground(new Color(0, 0, 0));
        icon.paintIcon(jl, g2, 0, 0);

        alpha = (float)0.5;
     
}
View Full Code Here

  public void plot(AbstractDrawer  draw) {
                  if (!visible) return;
   
                            TeXFormula formula = new TeXFormula(label);
                           
                            TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY, size);
                            icon.setTeXIconColor(plotColor);
                            //icon.setInsets(new Insets(5, 5, 5, 5));

                            Graphics2D g2 = draw.getGraphics();
                            g2.setColor(plotColor);
                           
                            JLabel jl = new JLabel();
                           
                             jl.setForeground(plotColor)// GlobalValues.defaultFormulaColor);
                            if (useLogical == false)   // do not use logical coordinates
                              icon.paintIcon(jl, g2, coordx, coordy);
                            else  // use logical coordinates to place the formula
                            {
                                double [] logicalCoords = { logicalx, logicaly};
                                int [] screenCoords = draw.project(logicalCoords[0], logicalCoords[1]);
                                icon.paintIcon(jl, g2, screenCoords[0], screenCoords[1]);
                               

  }
        }
View Full Code Here

            currentPlot.addPlotable(tximg);
        }
       
        public static void  latexRender(String latex)  {
                      TeXFormula tf = new TeXFormula(latex);
                      TeXIcon icontf = tf.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20);
                      icontf.setInsets(new Insets(5, 5, 5, 5));
 
                      OutputTextPane otp = new OutputTextPane();
                      otp.addIcon(icontf,  0, true);
      JPanel jp = new JPanel();
                      jp.add(otp);
View Full Code Here

        return null;
      final NodeStyleController ncs = NodeStyleController.getController(textController.getModeController());
      final int maxWidth = ncs.getMaxWidth(node);
      TeXText teXt = new TeXText(latext);
      int fontSize = Math.round(ncs.getFontSize(node) * UITools.FONT_SCALE_FACTOR);
      TeXIcon icon = teXt.createTeXIcon(TeXConstants.STYLE_DISPLAY, fontSize, TeXConstants.ALIGN_LEFT, maxWidth);
      return icon;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.scilab.forge.jlatexmath.TeXIcon

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.