Beispiel #1
0
 public void setValue(String s) {
   getControls();
   if (!noUpdate && langBox != null && countryBox != null) {
     SequenceEncoder.Decoder sd = new SequenceEncoder.Decoder(s, ',');
     setLanguage(sd.nextToken(Locale.getDefault().getLanguage()));
     setCountry(sd.nextToken(""));
   }
   setValue((Object) s);
 }
 public Command decode(String command) {
   Command c = null;
   if (command.startsWith(COMMAND_PREFIX)) {
     SequenceEncoder.Decoder st =
         new SequenceEncoder.Decoder(command.substring(COMMAND_PREFIX.length()), '\t');
     String owner = st.nextToken();
     String text =
         st.hasMoreTokens() ? TextConfigurer.restoreNewlines(st.nextToken()) : ""; // $NON-NLS-1$
     return new SetPrivateTextCommand(this, new PrivateText(owner, text));
   }
   return c;
 }
Beispiel #3
0
 public void mySetState(String newState) {
   pointList.clear();
   final SequenceEncoder.Decoder ss = new SequenceEncoder.Decoder(newState, ';');
   globalVisibility = ss.nextBoolean(initiallyVisible);
   startMapId = ss.nextToken("");
   final int items = ss.nextInt(0);
   for (int i = 0; i < items; i++) {
     final String point = ss.nextToken("");
     if (point.length() != 0) {
       final SequenceEncoder.Decoder sp = new SequenceEncoder.Decoder(point, ',');
       final int x = sp.nextInt(0);
       final int y = sp.nextInt(0);
       pointList.add(new Point(x, y));
     }
   }
 }
Beispiel #4
0
  public static Item decode(GamePieceLayout l, String s) {

    SequenceEncoder.Decoder sd = new SequenceEncoder.Decoder(s, ';');

    ShapeItem item = new ShapeItem(l);

    sd.nextToken();
    item.width = sd.nextInt(30);
    item.height = sd.nextInt(40);
    item.shape = sd.nextToken(RECT);
    item.bevel = sd.nextInt(5);

    return item;
  }
Beispiel #5
0
  /** Type is the character command that toggles footprint visiblity */
  public void mySetType(String type) {
    final SequenceEncoder.Decoder st = new SequenceEncoder.Decoder(type, ';');
    st.nextToken();

    trailKey = st.nextKeyStroke(DEFAULT_TRAIL_KEY);
    menuCommand = st.nextToken(DEFAULT_MENU_COMMAND);
    initiallyVisible = st.nextBoolean(DEFAULT_INITIALLY_VISIBLE.booleanValue());
    globallyVisible = st.nextBoolean(DEFAULT_GLOBALLY_VISIBLE.booleanValue());
    circleRadius = st.nextInt(DEFAULT_CIRCLE_RADIUS);
    fillColor = st.nextColor(DEFAULT_FILL_COLOR);
    lineColor = st.nextColor(DEFAULT_LINE_COLOR);
    selectedTransparency = st.nextInt(DEFAULT_SELECTED_TRANSPARENCY);
    unSelectedTransparency = st.nextInt(DEFULT_UNSELECTED_TRANSPARENCY);
    edgePointBuffer = st.nextInt(DEFAULT_EDGE_POINT_BUFFER);
    edgeDisplayBuffer = st.nextInt(DEFAULT_EDGE_DISPLAY_BUFFER);
    lineWidth = st.nextDouble(LINE_WIDTH);

    commands = null;
    showTrailCommand = null;

    if (initiallyVisible) {
      localVisibility = true;
      globalVisibility = true;
    }
  }
Beispiel #6
0
 public static Locale stringToLocale(String s) {
   SequenceEncoder.Decoder sd = new SequenceEncoder.Decoder(s, ',');
   return new Locale(sd.nextToken(""), sd.nextToken(""));
 }