Examples of toBox()


Examples of ket.math.Argument.toBox()

    topD.setArgument(argument);
    Vector<Box> boxArgs = BoxTools.padArgs(args, 1, colourScheme);
    Box topRowBox;
    Box orderBox;
    if (orderArgument!=null) {
      orderBox = orderArgument.toBox(settings, colourScheme);
      orderBox.clearArgument();
      if (1<args.size()) { // multiple
        topRowBox = BoxTools.centredHorizontalBoxList(argument, 0L, topD, orderBox, boxArgs.firstElement())// d ^n x
      } else {
        topRowBox = BoxTools.centredHorizontalBoxList(argument, 0L, topD, orderBox);
View Full Code Here

Examples of ket.math.Argument.toBox()

    g2D.drawString(label, dx, ascent+dy);
  }

  public static ImageIcon asIcon(String expression, String label) {
    Argument argument = ArgumentParser.parseArgument(expression, knownArguments, null, mathCollection); // null clipboard
    Box box = argument.toBox(Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN, colourScheme);
    BufferedImage image = ImageTools.boxToBufferedImage(box, 160, 120, colourScheme, false);
    labelImage(image, label);
    ImageIcon imageIcon = new ImageIcon(image);
    return imageIcon;
  }
View Full Code Here

Examples of ket.math.Argument.toBox()

    //- for (Argument a : family) {
    for (int count=0; count<family.size(); count++) {
      Argument a = family.get(count);
      int i = count / columns;
      int j = count % columns;
      Box box = a.toBox(0L, document.getColourScheme());
      box.setup(Box.DEFAULT_BOX_FONT_SIZE, new Offset(20, 20)); // Use a fixed icon size?
      BufferedImage image = ImageTools.paintInnerBoxToImage(box, false, document.getColourScheme());
      JButton button = new JButton();
      button.setIcon(new ImageIcon(image));
      //> button.setRolloverIcon(new ImageIcon()); // Highlighted or bold version?
View Full Code Here

Examples of ket.math.Equation.toBox()

        sizes.add(e.getVisibleRoot().recursiveSize());

        // TODO: Expensive: Only evaluate for small numbers of equations.
        //> if (equations.size()<MAX_DRAW_SIZE) {
        //- figs.add(e.toBox(colourScheme).toBufferedImage(width, height, colourScheme));
        figs.add(e.toBox(colourScheme).toBufferedImage(ICON_WIDTH, ICON_HEIGHT, colourScheme, false));
        //> }
      }
    }
    invisibleArgs.removeAll(visible);
    invisibleText.removeAll(visible);
View Full Code Here

Examples of ket.math.purpose.SymbolicState.toBox()

        default:
          SymbolicState infixSymbol = isInfix() ? getInfix() : Symbol.COMMA;
          for (int i=0; i<boxArgs.size()-1; i++) {
            boxes.add(boxArgs.get(i));
            Box inf = infixSymbol.toBox(argument, Box.PLAIN_FONT, colourScheme);
            //- inf.setArgument(argument);
            boxes.add(inf);
          }
          boxes.add(boxArgs.lastElement());
      }
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.