public void paintComponent(Graphics g1) {
   Graphics2D g = (Graphics2D) g1;
   float width = getWidth();
   float height = getHeight();
   AffineTransform save = g.getTransform();
   AffineTransform save_tmp;
   g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
   if (45.0 <= rotate && rotate < 135.0) {
     g.translate(width, 0.0);
     g.rotate(Math.PI * rotate / 180, 0.0, 0.0);
     g.transform(
         AffineTransform.getScaleInstance(height / original_width, width / original_height));
   } else if (135.0 <= rotate && rotate < 225.0) {
     g.rotate(Math.PI * rotate / 180, width / 2, height / 2);
     g.transform(
         AffineTransform.getScaleInstance(width / original_width, height / original_height));
   } else if (225.0 <= rotate && rotate < 315.0) {
     g.translate(-height, 0.0);
     g.rotate(Math.PI * rotate / 180, height, 0.0);
     g.transform(
         AffineTransform.getScaleInstance(height / original_width, width / original_height));
   } else
     g.transform(
         AffineTransform.getScaleInstance(width / original_width, height / original_height));
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           30,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[0]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           32,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[1]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           32,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[2]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           33,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[3]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           33,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[4]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           32,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[5]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           30,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[6]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           33,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[7]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           32,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[8]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           30,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[9]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           32,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[10]);
   g.setStroke(new BasicStroke(2F));
   g.setColor(
       GeColor.getColor(
           32,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[11]);
   g.setTransform(save);
 }
 public void paintComponent(Graphics g1) {
   animationCount = 1;
   if (!visible) return;
   Graphics2D g = (Graphics2D) g1;
   float width = getWidth();
   float height = getHeight();
   g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
   if (45.0 <= rotate && rotate < 135.0) {
     g.translate(width, 0.0);
     g.rotate(Math.PI * rotate / 180, 0.0, 0.0);
     g.transform(
         AffineTransform.getScaleInstance(height / original_width, width / original_height));
   } else if (135.0 <= rotate && rotate < 225.0) {
     g.rotate(Math.PI * rotate / 180, width / 2, height / 2);
     g.transform(
         AffineTransform.getScaleInstance(width / original_width, height / original_height));
   } else if (225.0 <= rotate && rotate < 315.0) {
     g.translate(-height, 0.0);
     g.rotate(Math.PI * rotate / 180, height, 0.0);
     g.transform(
         AffineTransform.getScaleInstance(height / original_width, width / original_height));
   } else
     g.transform(
         AffineTransform.getScaleInstance(width / original_width, height / original_height));
   if ((dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
     g.rotate(
         Math.PI * dd.rotate / 180,
         (dd.x0 - getX()) * original_width / width,
         (dd.y0 - getY()) * original_height / height);
   }
   AffineTransform save = g.getTransform();
   AffineTransform save_tmp;
   int rounds = 1;
   if (fillLevel != 1F) rounds = 2;
   int oldColor = 0;
   for (int i = 0; i < rounds; i++) {
     if (rounds == 2) {
       switch (i) {
         case 0:
           if (levelColorTone != GeColor.COLOR_TONE_NO) {
             oldColor = colorTone;
             colorTone = levelColorTone;
           } else if (levelFillColor != GeColor.COLOR_NO) {
             oldColor = fillColor;
             fillColor = levelFillColor;
           }
           break;
         case 1:
           if (levelColorTone != GeColor.COLOR_TONE_NO) colorTone = oldColor;
           else if (levelFillColor != GeColor.COLOR_NO) fillColor = oldColor;
           break;
       }
       switch (levelDirection) {
         case Ge.DIRECTION_UP:
           if (i == 0)
             g.setClip(
                 new Rectangle2D.Float(
                     0F,
                     fillLevel * original_height + Ge.cJBean_Offset,
                     original_width,
                     original_height));
           else
             g.setClip(
                 new Rectangle2D.Float(
                     0F, 0F, original_width, fillLevel * original_height + Ge.cJBean_Offset));
           break;
         case Ge.DIRECTION_DOWN:
           if (i == 0)
             g.setClip(
                 new Rectangle2D.Float(
                     0F,
                     0F,
                     original_width,
                     (1 - fillLevel) * original_height + Ge.cJBean_Offset));
           else
             g.setClip(
                 new Rectangle2D.Float(
                     0F,
                     (1 - fillLevel) * original_height + Ge.cJBean_Offset,
                     original_width,
                     original_height));
           break;
         case Ge.DIRECTION_RIGHT:
           if (i == 0)
             g.setClip(
                 new Rectangle2D.Float(
                     fillLevel * original_width + Ge.cJBean_Offset,
                     0F,
                     original_width,
                     original_height));
           else
             g.setClip(
                 new Rectangle2D.Float(0F, 0F, fillLevel * width + Ge.cJBean_Offset, height));
           break;
         case Ge.DIRECTION_LEFT:
           if (i == 0)
             g.setClip(
                 new Rectangle2D.Float(
                     0F,
                     0F,
                     (1 - fillLevel) * original_width + Ge.cJBean_Offset,
                     original_height));
           else
             g.setClip(
                 new Rectangle2D.Float(
                     (1 - fillLevel) * original_width + Ge.cJBean_Offset,
                     0F,
                     original_width,
                     original_height));
           break;
       }
     }
     {
       int fcolor =
           GeColor.getDrawtype(
               293,
               colorTone,
               colorShift,
               colorIntensity,
               colorBrightness,
               colorInverse,
               fillColor,
               dimmed);
       if (gradient == GeGradient.eGradient_No) {
         g.setColor(GeColor.getColor(fcolor));
         g.fill(shapes[0]);
       } else {
         GeGradient.paint(
             g,
             gradient,
             2,
             -2,
             2F,
             2F,
             13.6808F,
             14.8208F,
             false,
             293,
             colorTone,
             colorShift,
             colorIntensity,
             colorInverse,
             fillColor,
             dimmed);
         g.fill(shapes[0]);
       }
       if (shadow != 0) {
         g.setColor(GeColor.shiftColor(fcolor, -2, colorInverse));
         g.fill(shapes[1]);
         g.setColor(GeColor.shiftColor(fcolor, 2, colorInverse));
         g.fill(shapes[2]);
       }
       g.setStroke(new BasicStroke(1F));
       g.setColor(
           GeColor.getColor(
               0,
               colorTone,
               colorShift,
               colorIntensity,
               colorBrightness,
               colorInverse,
               borderColor,
               dimmed));
       g.draw(shapes[0]);
     }
   }
   if (rounds == 2) g.setClip(null);
   g.setTransform(save);
 }
 public void paintComponent(Graphics g1) {
   Graphics2D g = (Graphics2D) g1;
   float width = getWidth();
   float height = getHeight();
   g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
   double scaleWidth = (1.0 * width / original_width);
   double scaleHeight = (1.0 * height / original_height);
   AffineTransform save = g.getTransform();
   g.setColor(getBackground());
   g.fill(new Rectangle(0, 0, getWidth(), getHeight()));
   g.transform(AffineTransform.getScaleInstance(scaleWidth, scaleHeight)); // scaletest
   AffineTransform save_tmp;
   g.setColor(
       GeColor.getColor(
           0,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           textColor,
           dimmed));
   g.setFont(new Font("Helvetica", Font.BOLD, 12));
   g.drawString(JopLang.transl("Status"), 13, 91);
   g.setColor(
       GeColor.getColor(
           0,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           textColor,
           dimmed));
   g.setFont(new Font("Helvetica", Font.BOLD, 12));
   g.drawString(JopLang.transl("LogMessage"), 13, 114);
   g.setColor(
       GeColor.getColor(
           0,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           textColor,
           dimmed));
   g.setFont(new Font("Helvetica", Font.BOLD, 12));
   g.drawString(JopLang.transl("EventListSize"), 13, 23);
   g.setColor(
       GeColor.getColor(
           0,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           textColor,
           dimmed));
   g.setFont(new Font("Helvetica", Font.BOLD, 12));
   g.drawString(JopLang.transl("EventLogSize"), 13, 44);
   g.setColor(
       GeColor.getColor(
           0,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           textColor,
           dimmed));
   g.setFont(new Font("Helvetica", Font.BOLD, 12));
   g.drawString(JopLang.transl("MaxApplAlarms"), 13, 67);
   g.setTransform(save);
 }
 public void geInit() {
   JopSpider.setSystemName("䣷D‘ú·D‘ú·p—uÄŸ¢·{¨· s¨·È‡Æ¿ç韷D‘ú·D‘ú·x—u s¨·");
   engine.setAnimationScanTime(500);
   engine.setScanTime(500);
   size = new Dimension(711, 169);
   Dimension dsize = new Dimension(localPanel.original_width, localPanel.original_height);
   this.addComponentListener(new AspectRatioListener(this, size));
   contentPane = (JPanel) this.getContentPane();
   contentPane.setLayout(borderLayout1);
   if (scrollbar) contentPane.add(new JScrollPane(localPanel), BorderLayout.CENTER);
   else contentPane.add(localPanel, BorderLayout.CENTER);
   contentPane.setOpaque(true);
   localPanel.setLayout(new RatioLayout()); // scaletest
   localPanel.setOpaque(true);
   localPanel.setBackground(GeColor.getColor(51, GeColor.NO_COLOR));
   this.setSize(size);
   if (engine.isInstance()) setTitle(engine.getInstance());
   else this.setTitle("JopcMessagehandler");
   pwr_indsquare2 = new pwr_indsquare(session);
   pwr_indsquare2.setBounds(new Rectangle(133, 78, 15, 16));
   localPanel.add(pwr_indsquare2, new Proportion(pwr_indsquare2.getBounds(), dsize));
   pwr_indsquare3 = new pwr_indsquare(session);
   pwr_indsquare3.setBounds(new Rectangle(133, 99, 15, 16));
   localPanel.add(pwr_indsquare3, new Proportion(pwr_indsquare3.getBounds(), dsize));
   pwr_valuelong4 = new pwr_valuelong(session);
   pwr_valuelong4.setBounds(new Rectangle(151, 77, 535, 17));
   pwr_valuelong4.setBorderColor(33);
   localPanel.add(pwr_valuelong4, new Proportion(pwr_valuelong4.getBounds(), dsize));
   pwr_valuelong5 = new pwr_valuelong(session);
   pwr_valuelong5.setBounds(new Rectangle(151, 99, 535, 17));
   pwr_valuelong5.setBorderColor(33);
   localPanel.add(pwr_valuelong5, new Proportion(pwr_valuelong5.getBounds(), dsize));
   pwr_valuesmall7 = new pwr_valuesmall(session);
   pwr_valuesmall7.setBounds(new Rectangle(133, 10, 54, 17));
   pwr_valuesmall7.setFillColor(31);
   pwr_valuesmall7.setBorderColor(33);
   localPanel.add(pwr_valuesmall7, new Proportion(pwr_valuesmall7.getBounds(), dsize));
   pwr_valuesmall9 = new pwr_valuesmall(session);
   pwr_valuesmall9.setBounds(new Rectangle(133, 31, 54, 17));
   pwr_valuesmall9.setFillColor(31);
   pwr_valuesmall9.setBorderColor(33);
   localPanel.add(pwr_valuesmall9, new Proportion(pwr_valuesmall9.getBounds(), dsize));
   pwr_valuesmall11 = new pwr_valuesmall(session);
   pwr_valuesmall11.setBounds(new Rectangle(133, 54, 54, 17));
   pwr_valuesmall11.setFillColor(31);
   pwr_valuesmall11.setBorderColor(33);
   localPanel.add(pwr_valuesmall11, new Proportion(pwr_valuesmall11.getBounds(), dsize));
   pwr_indsquare2.dd.setDynType(33554432);
   pwr_indsquare2.dd.setActionType(0);
   pwr_indsquare2.dd.setElements(
       new GeDynElemIfc[] {
         new GeDynStatusColor(pwr_indsquare2.dd, "$node.ProcStatus[6]##status", 38)
       });
   pwr_indsquare3.dd.setDynType(33554432);
   pwr_indsquare3.dd.setActionType(0);
   pwr_indsquare3.dd.setElements(
       new GeDynElemIfc[] {
         new GeDynStatusColor(pwr_indsquare3.dd, "$node.ProcMsgSeverity[6]##status", 38)
       });
   pwr_valuelong4.dd.setDynType(1025);
   pwr_valuelong4.dd.setActionType(0);
   pwr_valuelong4.dd.setElements(
       new GeDynElemIfc[] {
         new GeDynValue(pwr_valuelong4.dd, "$node.ProcStatus[6]##Status", "%1m")
       });
   pwr_valuelong5.dd.setDynType(1025);
   pwr_valuelong5.dd.setActionType(0);
   pwr_valuelong5.dd.setElements(
       new GeDynElemIfc[] {
         new GeDynValue(pwr_valuelong5.dd, "$node.ProcMessage[6]##String80", "%s")
       });
   pwr_valuesmall7.dd.setDynType(1025);
   pwr_valuesmall7.dd.setActionType(0);
   pwr_valuesmall7.dd.setElements(
       new GeDynElemIfc[] {
         new GeDynValue(pwr_valuesmall7.dd, "$object.EventListSize##Int32", "%d")
       });
   pwr_valuesmall9.dd.setDynType(1025);
   pwr_valuesmall9.dd.setActionType(0);
   pwr_valuesmall9.dd.setElements(
       new GeDynElemIfc[] {
         new GeDynValue(pwr_valuesmall9.dd, "$object.EventLogSize##Int32", "%d")
       });
   pwr_valuesmall11.dd.setDynType(1025);
   pwr_valuesmall11.dd.setActionType(0);
   pwr_valuesmall11.dd.setElements(
       new GeDynElemIfc[] {
         new GeDynValue(pwr_valuesmall11.dd, "$object.MaxApplAlarms##Int32", "%d")
       });
   engine.setFrameReady();
 }
Exemple #5
0
 public void paintComponent(Graphics g1) {
   Graphics2D g = (Graphics2D) g1;
   float width = getWidth();
   float height = getHeight();
   AffineTransform save = g.getTransform();
   AffineTransform save_tmp;
   g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
   if (45.0 <= rotate && rotate < 135.0) {
     g.translate(width, 0.0);
     g.rotate(Math.PI * rotate / 180, 0.0, 0.0);
     g.transform(
         AffineTransform.getScaleInstance(height / original_width, width / original_height));
   } else if (135.0 <= rotate && rotate < 225.0) {
     g.rotate(Math.PI * rotate / 180, width / 2, height / 2);
     g.transform(
         AffineTransform.getScaleInstance(width / original_width, height / original_height));
   } else if (225.0 <= rotate && rotate < 315.0) {
     g.translate(-height, 0.0);
     g.rotate(Math.PI * rotate / 180, height, 0.0);
     g.transform(
         AffineTransform.getScaleInstance(height / original_width, width / original_height));
   } else
     g.transform(
         AffineTransform.getScaleInstance(width / original_width, height / original_height));
   g.setColor(
       GeColor.getColor(
           22,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           fillColor,
           false));
   g.fill(shapes[0]);
   g.setColor(
       GeColor.getColor(
           20,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           fillColor,
           false));
   g.fill(shapes[1]);
   g.setColor(
       GeColor.getColor(
           23,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           fillColor,
           false));
   g.fill(shapes[2]);
   g.setStroke(new BasicStroke(1F));
   g.setColor(
       GeColor.getColor(
           0,
           colorTone,
           colorShift,
           colorIntensity,
           colorBrightness,
           colorInverse,
           borderColor,
           false));
   g.draw(shapes[3]);
   g.setColor(Color.black);
   g.setFont(annot1Font);
   save_tmp = g.getTransform();
   g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
   g.transform(
       AffineTransform.getScaleInstance(original_width / width * height / original_height, 1));
   g.drawString(annot1, 13 * original_height / height * width / original_width, 22F);
   g.setTransform(save_tmp);
   g.setTransform(save);
 }