Пример #1
0
 public virtual void shiftToBack(DisplayElement element)
 {
   int num1 = 0;
   this.elements.remove((object) element);
   Iterator iterator = ((AbstractSequentialList) this.elements).iterator();
   while (iterator.hasNext())
   {
     DisplayElement displayElement1 = (DisplayElement) iterator.next();
     JPanel jpanel = this.backPane;
     DisplayElement displayElement2 = displayElement1;
     int num2 = num1;
     ++num1;
     ((Container) jpanel).setComponentZOrder((Component) displayElement2, num2);
   }
   ((Container) this.backPane).setComponentZOrder((Component) element, num1);
   this.elements.add((object) element);
   ((Component) this).repaint();
 }
Пример #2
0
 private void prepareElementMenu([In] DisplayElement obj0)
 {
   this.menuElement = obj0;
   Dimension savedSize = this.menuElement.getSavedSize();
   this.resizeMenu.setEnabled(savedSize.width != -1 || savedSize.height != -1);
   if (obj0 is Widget)
   {
     DataType type = ((Widget) obj0).getType();
     if (type == null)
     {
       ((JMenuItem) this.changeToMenu).setEnabled(false);
     }
     else
     {
       ((JMenuItem) this.changeToMenu).setEnabled(true);
       Set widgetsForType = DisplayElementRegistry.getWidgetsForType(type);
       this.changeToMenu.removeAll();
       int num = 0;
       Iterator iterator = widgetsForType.iterator();
       while (iterator.hasNext())
       {
         Class clazz = (Class) iterator.next();
         if (!Object.instancehelper_equals((object) clazz, (object) Object.instancehelper_getClass((object) obj0)))
         {
           ++num;
           this.changeToMenu.add((Action) new GlassPane.ChangeToAction(this, DisplayElement.getName(clazz), clazz, (GlassPane\u00241) null));
         }
       }
       if (num != 0)
         return;
       ((JMenuItem) this.changeToMenu).setEnabled(false);
     }
   }
   else
     ((JMenuItem) this.changeToMenu).setEnabled(false);
 }
Пример #3
0
 public virtual void addElement(DisplayElement element, Point point)
 {
   element.init();
   if (point == null)
   {
     Dimension savedSize = element.getSavedSize();
     Dimension preferredSize = ((JComponent) element).getPreferredSize();
     if (savedSize.width > 0)
       preferredSize.width = savedSize.width;
     if (savedSize.height > 0)
       preferredSize.height = savedSize.height;
     ((Component) element).setSize(preferredSize);
     point = this.findSpace(element);
     ((Component) element).setBounds(new Rectangle(point, preferredSize));
   }
   element.setSavedLocation(point);
   ((Container) this.backPane).add((Component) element);
   int num1 = 1;
   Iterator iterator = ((AbstractSequentialList) this.elements).iterator();
   while (iterator.hasNext())
   {
     DisplayElement displayElement1 = (DisplayElement) iterator.next();
     JPanel jpanel = this.backPane;
     DisplayElement displayElement2 = displayElement1;
     int num2 = num1;
     ++num1;
     ((Container) jpanel).setComponentZOrder((Component) displayElement2, num2);
   }
   ((Container) this.backPane).setComponentZOrder((Component) element, 0);
   this.elements.addFirst((object) element);
   ((JComponent) this).revalidate();
   ((Component) this).repaint();
 }
Пример #4
0
 private void setSelected([In] DisplayElement obj0)
 {
   if (this.selectedElement == obj0)
     return;
   this.selectedElement = obj0;
   if (this.selectedElement == null)
     this.areas.clear();
   else
     this.defineBounds();
   ((Component) this).repaint();
 }