Examples of BoxWord


Examples of ket.display.box.BoxWord

  }

  @Override
  public Box toBox(Argument argument, long settings, ColourScheme colourScheme, Vector<Argument> args) {
    if (args.size()>0) {
      BoxWord dBox = new BoxWord(null, "d", 0L);
      return BoxFactory.derivative(argument, dBox, getArgUpperLimit(), args, settings, colourScheme);
    } else {
      return super.toBox(argument, settings, colourScheme, args);
    }
  }
View Full Code Here

Examples of ket.display.box.BoxWord

      for (Box b : boxArgs) {
        if (b.getArgument()==null) {
          b.setArgument(argument);
        }
      }
      Box log = new BoxWord(argument, "log", Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN|Box.PLAIN_FONT);
      Box base = boxArgs.get(0);
      base.setProperty(Box.X_CENTRE_ALIGN|Box.BOTTOM_ALIGN|Box.SMALL_FONT);
      // TODO: Add a bracketWhenAppropriate() method.
      Box arg = boxArgs.get(1);
      arg.setProperty(Box.LEFT_ALIGN|Box.Y_CENTRE_ALIGN);
View Full Code Here

Examples of ket.display.box.BoxWord

      case 2:
      case 3:
        BoxGraphic verticalBar2 = new BoxGraphic(argument, Box.X_CENTRE_ALIGN|Box.VERTICAL_STRETCH, BoxGraphic.VERTICAL_LINE);
        Box subject = boxArgs.get(0);
        Box from = boxArgs.get(1);
        Box to = boxArgs.size()==3 ? boxArgs.get(2) : new BoxWord(argument, " ", 0L);
        BoxList boxList = new BoxList(argument, settings);
        boxList.nextHorizontalPath(new Box[]{to});
        boxList.nextHorizontalPath(new Box[]{subject, verticalBar2});
        boxList.nextHorizontalPath(new Box[]{from});
        boxList.nextVerticalPath(new Box[]{subject});
View Full Code Here

Examples of ket.display.box.BoxWord

  @Override
  public Box toBox(Argument argument, long settings, ColourScheme colourScheme) {
    // TODO: Is it always appropriate to have a null argument associated with the return value?
    // TODO: Is is appropriate that Text.toBox() creates boxWord instances?
    return new BoxWord(argument, getValue(), settings);
  }
View Full Code Here

Examples of ket.display.box.BoxWord

          value = value.substring(0, shift); //ish
        }
      } else {
        //...
      }
      return new BoxWord(argument, value, settings);
    }
    String[] string = Suffix.suffix(value);
    switch (string.length) {
      case 1:
        return new BoxWord(argument, string[0], settings);

      case 2:
        // Repeated pattern new String[]{number.number, pattern};
        BoxWord prefix = new BoxWord(argument, string[0], settings);
        BoxWord pattern = new BoxWord(argument, string[1], settings);
        BoxGraphic horizontalBar = new BoxGraphic(argument, 0L, BoxGraphic.HORIZONTAL_LINE);
        Box argsAndOverbar = BoxTools.centredVerticalBoxList(argument, settings, horizontalBar, pattern);
        Box box = BoxTools.centredHorizontalBoxList(argument, 0L, prefix, argsAndOverbar);
        horizontalBar.setProperty(Box.HORIZONTAL_STRETCH);
        horizontalBar.setProperty(Box.BOTTOM_ALIGN);
        return box;

      default:
        // Never used, but just in case.
        return new BoxWord(argument, getValue(), settings);
    }
  }
View Full Code Here

Examples of ket.display.box.BoxWord

    }
    Vector<Box> boxArgs = BoxTools.padArgs(args, 2*columns, colourScheme);
    Box[][] table = new Box[columns][3];
    for (int i=0; i<2*columns; i+=2) {
      table[i/2][0] = boxArgs.get(i);
      table[i/2][1] = new BoxWord(null, "  ", Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN);
      table[i/2][2] = boxArgs.get(i+1);
    }
    return table;
  }
View Full Code Here

Examples of ket.display.box.BoxWord

    Box clickedOn = messageBox.findDeepestBox(p);
    boolean messageBoxClick = clickedOn!=null;
    if (!messageBoxClick) return false;
    Vector<Box> children = messageBox.getChildren();
    if (children.size()!=3) return false;
    BoxWord startBoxWord = (BoxWord) children.get(0);
    BoxWord endBoxWord = (BoxWord) children.get(2);
    int index = -1;
    if (startBoxWord==clickedOn) {
      index = startBoxWord.getIndex(p)-1;
    } else if (endBoxWord==clickedOn) {
      // Including cursor index.
      int indent = message.getStart().length();
      index = indent + endBoxWord.getIndex(p) + 1;
    } else {
      return false;
    }
    if (index==-1) return false;
    message.setIndex(index);
View Full Code Here

Examples of ket.display.box.BoxWord

    ColourScheme colourScheme = (ColourScheme) document.getColourScheme();
    Color selectedColour = colourScheme.getHighlightedColour(0);
    Color backgroundColour = colourScheme.getBackgroundColour();

    // text colour: highlight ? selectedColour : backgroundColour;
    BoxWord startBoxWord = new BoxWord(KET_PANEL, startString, 0L);
    BoxWord endBoxWord = new BoxWord(KET_PANEL, endString, 0L);

    if (getModes().getDocumentState()==DocumentState.UPDATE_TEXT) {
      // Text doesn't require a separate message box.
      this.messageBoxList = null;
      this.messageBox = null;
    } else if (message.getMode()==Message.APPEND_MODE) {
      // WARNING: Message box's contents can't be found with findDeepestArgument() if they have a null argument.
      BoxWord gapBox = new BoxWord(KET_PANEL, "|", 0L);
      messageBoxList = BoxTools.centredHorizontalBoxList(KET_PANEL, 0L, startBoxWord, gapBox, endBoxWord);
      //- messageBox = new BorderedBox(MESSAGE, messageBoxList, Box.X_CENTRE_ALIGN|Box.BOTTOM_ALIGN, false, colourScheme.getPlainTextColour(), colourScheme);
      messageBox = new BorderedBox(MESSAGE, messageBoxList, Box.X_CENTRE_ALIGN|Box.BOTTOM_ALIGN, false, colourScheme);
    } else if (messageString.length()>0) { // Echo and error modes.
      // TODO: Don't display the cursor in error or echo responder: only in edit responder.
View Full Code Here

Examples of ket.display.box.BoxWord

  }

  public Box toBox(Argument argument, long settings, ColourScheme colourScheme) {
    // Get bold / regular settings from here.
    //settings |= Box.PLAIN_FONT;
    return new BoxWord(argument, toUnicode(), settings);
  }
View Full Code Here

Examples of ket.display.box.BoxWord

  public Box toBox(long settings, ColourScheme colourScheme) {
    if (isBold()) { //?
      settings |= Box.BOLD_FONT;
    }
    //- Box box = new BoxWord(this, Symbol.HIDDEN.toUnicode(), settings, colourScheme.getBoxColour(this));
    Box box = new BoxWord(this, Symbol.HIDDEN.toUnicode(), settings);
    box.setArgument(this); //? Redundant?
    return box;
  }
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.