void showResults() {
   int count = rt.getCounter();
   // if (count==0) return;
   boolean lastSlice = !processStack || slice == imp.getStackSize();
   if ((showChoice == OVERLAY_OUTLINES || showChoice == OVERLAY_MASKS) && slice == 1 && count > 0)
     imp.setOverlay(overlay);
   else if (outlines != null && lastSlice) {
     String title = imp != null ? imp.getTitle() : "Outlines";
     String prefix;
     if (showChoice == MASKS) prefix = "Mask of ";
     else if (showChoice == ROI_MASKS) prefix = "Count Masks of ";
     else prefix = "Drawing of ";
     outlines.update(drawIP);
     outputImage = new ImagePlus(prefix + title, outlines);
     if (inSituShow) {
       if (imp.getStackSize() == 1) Undo.setup(Undo.TRANSFORM, imp);
       imp.setStack(null, outputImage.getStack());
     } else if (!hideOutputImage) outputImage.show();
   }
   if (showResults && !processStack) {
     TextPanel tp = IJ.getTextPanel();
     if (beginningCount > 0 && tp != null && tp.getLineCount() != count) rt.show("Results");
     Analyzer.firstParticle = beginningCount;
     Analyzer.lastParticle = Analyzer.getCounter() - 1;
   } else Analyzer.firstParticle = Analyzer.lastParticle = 0;
 }
 public void run(String arg) {
   GenericDialog gd = new GenericDialog("Options");
   gd.addCheckbox("Add_Titles", true);
   gd.addCheckbox("Close Original", false);
   gd.showDialog();
   if (gd.wasCanceled()) {
     return;
   }
   boolean addtitles = gd.getNextBoolean();
   boolean closeorig = gd.getNextBoolean();
   // first get the table window
   Frame[] niframes = WindowManager.getNonImageWindows();
   boolean first = true;
   TextWindow tw2 = null;
   int ncols = 0;
   String[] col_labels = null;
   for (int i = 0; i < niframes.length; i++) {
     if (niframes[i] instanceof TextWindow && !niframes[i].getTitle().equals("Log")) {
       TextWindow tw = (TextWindow) niframes[i];
       TextPanel tp = tw.getTextPanel();
       List<List<String>> listtable = table_tools.table2listtable(tp);
       if (listtable.size() == 0) {
         col_labels = table_tools.getcollabels(tp);
         ncols = col_labels.length;
         ArrayList<String> temp = new ArrayList<String>();
         for (int j = 0; j < ncols; j++) temp.add("");
         listtable.add(temp);
       }
       if (first) {
         col_labels = table_tools.getcollabels(tp);
         ncols = col_labels.length;
         String headings = tp.getColumnHeadings();
         if (addtitles) {
           String[] titles = repeated(tw.getTitle(), listtable.size());
           table_tools.add_listtable_column(listtable, titles, 0);
           headings = "name\t" + headings;
         }
         tw2 =
             new TextWindow(
                 "Combined Table", headings, table_tools.print_listtable(listtable), 400, 200);
         first = false;
       } else {
         if (addtitles) {
           String[] titles = repeated(tw.getTitle(), listtable.size());
           table_tools.add_listtable_column(listtable, titles, 0);
         }
         tw2.append(table_tools.print_listtable(listtable));
       }
       if (closeorig) tw.close();
     }
   }
 }
Exemplo n.º 3
0
  public void showTextPanel(TextTag textTag) {
    if (mainPanel.isInternalFlashViewerSelected() /*|| ft instanceof GFxDefineCompactedFont*/) {
      showImagePanel(MainPanel.makeTimelined(textTag), textTag.getSwf(), 0);
    }

    showCardRight(CARDTEXTPANEL);
    parametersPanel.setVisible(true);
    textPanel.setText(textTag);
  }
  private void toggleHelp() {
    if (help != null) {
      clearHelp();
      return;
    }
    final int nbMonsters = monsters.size();

    /* Prepare the String to display */
    final IColoredString<Color> cs = new IColoredString.Impl<Color>();
    cs.append("Still ", null);
    final Color nbColor;
    if (nbMonsters <= 1)
      /* Green */
      nbColor = Color.GREEN;
    else if (nbMonsters <= 5)
      /* Orange */
      nbColor = Color.ORANGE;
    else
      /* Red */
      nbColor = Color.RED;
    cs.appendInt(nbMonsters, nbColor);
    cs.append(" monster" + (nbMonsters == 1 ? "" : "s") + " to kill", null);

    IColoredString<Color> helping1 =
        new IColoredString.Impl<Color>("Use numpad or vi-keys (hjklyubn) to move.", Color.WHITE);
    IColoredString<Color> helping2 =
        new IColoredString.Impl<Color>(
            "Use ? for help, f to change colors, q to quit.", Color.WHITE);
    IColoredString<Color> helping3 =
        new IColoredString.Impl<Color>(
            "Click the top or bottom border of the lower message box to scroll.", Color.WHITE);

    final Actor a;
    /*
     * Use TextPanel. There's less work to do than with
     * GroupCombinedPanel, and we can use a more legible variable-width font.
     * It doesn't seem like it when reading this code, but this actually does
     * much more than GroupCombinedPanel,  because we do line wrapping and
     * justifying, without having to worry about sizes since TextPanel lays
     * itself out.
     */
    TextCellFactory tf =
        DefaultResources.getStretchableFont()
            // .setSmoothingMultiplier(2f / (INTERNAL_ZOOM + 1f))
            .width(cellWidth + 1)
            .height(cellHeight + 5)
            .initBySize();
    final TextPanel<Color> tp = new TextPanel<Color>(new GDXMarkup(), tf);
    tp.backgroundColor = SColor.DARK_SLATE_GRAY;

    final List<IColoredString<Color>> text = new ArrayList<IColoredString<Color>>();
    text.add(cs);
    /* No need to call IColoredString::wrap, TextPanel does it on its own */
    text.add(helping1);
    text.add(helping2);
    text.add(helping3);

    final float w = width * cellWidth, aw = helping3.length() * tf.width() * 0.8f * INTERNAL_ZOOM;
    final float h = height * cellHeight, ah = tf.height() * 7f * INTERNAL_ZOOM;
    tp.init(aw, ah, text);
    a = tp.getScrollPane();
    final float x = (w - aw) / 2f;
    final float y = (h - ah) / 2f;
    a.setPosition(x, y);
    stage.setScrollFocus(a);

    help = a;

    stage.addActor(a);
  }
Exemplo n.º 5
0
 public void paint(Graphics g) {
   bar_panel.repaint();
   text_panel.repaint(); // name.repaint();
   g.drawRect(0, 0, getSize().width - 1, getSize().height - 1);
 }
Exemplo n.º 6
0
 public void closeTag() {
   textPanel.closeTag();
 }
Exemplo n.º 7
0
 public void focusTextPanel() {
   textPanel.focusTextValue();
 }
Exemplo n.º 8
0
 @Override
 public boolean isEditing() {
   return textPanel.isEditing()
       || (genericSaveButton.isVisible() && genericSaveButton.isEnabled())
       || (metadataSaveButton.isVisible() && metadataSaveButton.isEnabled());
 }
Exemplo n.º 9
0
 @Override
 public boolean tryAutoSave() {
   // todo: implement
   return textPanel.tryAutoSave() && false;
 }