Ejemplo n.º 1
0
  @Override
  public void modelPropertyChange(PropertyChangeEvent evt) {
    // Object oldValue = evt.getOldValue();
    Object newValue = evt.getNewValue();
    String propName = evt.getPropertyName();

    if (BookController.StrandProps.UPDATE.check(propName)) {
      EntityUtil.refresh(mainFrame, scene.getStrand());
      setEndBgColor(scene.getStrand().getJColor());
      repaint();
      return;
    }

    if (BookController.SceneProps.UPDATE.check(propName)) {
      Scene newScene = (Scene) newValue;
      if (!newScene.getId().equals(scene.getId())) {
        // not this scene
        return;
      }
      scene = newScene;
      lbSceneNo.setText(scene.getChapterSceneNo(false));
      lbSceneNo.setToolTipText(scene.getChapterSceneToolTip());
      lbStatus.setIcon(scene.getStatusIcon());
      taTitle.setText(scene.getTitle());
      taTitle.setCaretPosition(0);
      tcText.setText(scene.getSummary());
      tcText.setCaretPosition(0);
      if (scene.hasSceneTs()) {
        if (!DateUtil.isZeroTimeDate(scene.getSceneTs())) {
          lbTime.setText(DateUtil.simpleDateTimeToString(this.scene.getSceneTs()));
        } else {
          lbTime.setText("");
        }
      }
      return;
    }

    if (BookController.ChronoViewProps.ZOOM.check(propName)) {
      setZoomedSize((Integer) newValue);
      refresh();
    }
  }
Ejemplo n.º 2
0
 public ChronoScenePanel(MainFrame mainFrame, Scene scene) {
   super(mainFrame, scene, true, Color.white, scene.getStrand().getJColor());
   init();
   initUi();
 }
Ejemplo n.º 3
0
 @SuppressWarnings("unchecked")
 private JTable createTable() {
   Part part = mainFrame.getCurrentPart();
   BookModel model = mainFrame.getBookModel();
   Session session = model.beginTransaction();
   PersonDAOImpl personDAO = new PersonDAOImpl(session);
   List persons = personDAO.findByCategories(selectedCategories);
   SceneDAOImpl sceneDAO = new SceneDAOImpl(session);
   List scenes = sceneDAO.findByPart(part);
   model.commit();
   String[] string1 = new String[scenes.size() + 1];
   string1[0] = "";
   int i = 1;
   Object scenesIterator = scenes.iterator();
   while (((Iterator) scenesIterator).hasNext()) {
     Scene scene = (Scene) ((Iterator) scenesIterator).next();
     string1[i] = ((Scene) scene).getChapterSceneNo(false);
     i++;
   }
   scenesIterator = new ArrayList();
   String[] string2 = new String[scenes.size() + 1];
   Iterator personsIterator = persons.iterator();
   Object localObject6;
   while (personsIterator.hasNext()) {
     Person person = (Person) personsIterator.next();
     int j = 0;
     Object[] string3 = new Object[scenes.size() + 1];
     string3[(j++)] = person.getAbbreviation();
     int n = 0;
     localObject6 = scenes.iterator();
     while (((Iterator) localObject6).hasNext()) {
       Scene localScene = (Scene) ((Iterator) localObject6).next();
       if (localScene.getPersons().contains(person)) {
         n = 1;
         string3[j] = ColorUtil.darker(localScene.getStrand().getJColor(), 0.05D);
       } else {
         string3[j] = null;
       }
       string2[j] = HtmlUtil.wrapIntoTable(localScene.getTitleText(true, 500));
       j++;
     }
     if ((cbShowUnusedPersons == null) || (cbShowUnusedPersons.isSelected()) || (n != 0)) {
       ((List) scenesIterator).add(string3);
     }
   }
   Object[][] localObject31 = new Object[((List) scenesIterator).size()][];
   i = 0;
   Iterator localObject4 = ((List) scenesIterator).iterator();
   while (((Iterator) localObject4).hasNext()) {
     Object[] arrayOfObject1 = (Object[]) ((Iterator) localObject4).next();
     localObject31[(i++)] = arrayOfObject1;
   }
   JTable ntable = new ReadOnlyTable((Object[][]) localObject31, string1);
   if (ntable.getModel().getRowCount() == 0) {
     return ntable;
   }
   ntable.getColumnModel().getColumn(0).setPreferredWidth(200);
   ntable.getColumnModel().getColumn(0).setCellRenderer(new HeaderTableCellRenderer());
   for (int k = 1; k < ntable.getColumnCount(); k++) {
     int m = ntable.getColumnModel().getColumn(k).getModelIndex();
     Object localObject5 = ntable.getModel().getValueAt(0, m);
     localObject6 = ntable.getColumnModel().getColumn(k);
     if ((localObject5 == null) || ((localObject5 instanceof Color))) {
       ((TableColumn) localObject6).setPreferredWidth(colWidth);
       ((TableColumn) localObject6).setCellRenderer(new ColorTableCellRenderer(false));
     }
   }
   ntable.setAutoResizeMode(0);
   ntable.getTableHeader().setReorderingAllowed(false);
   ToolTipHeader localToolTipHeader = new ToolTipHeader(ntable.getColumnModel());
   localToolTipHeader.setToolTipStrings((String[]) string2);
   localToolTipHeader.setToolTipText("Default ToolTip TEXT");
   ntable.setTableHeader(localToolTipHeader);
   return ntable;
 }