Alarm status drawing iow: recolour JInternalFrame components

Greetings,
Please have a look at this picture. It's a low res snapshot of
a few quite complicated components. Most of the functionality isn't
visible nor relevant in the example. What you're looking at is a real time
process of some sort. Things can go wrong in that process. In a previous
version of my views I'd turn the background colour of some components
red/yellow/green according to the 'alarm status' of the process. One of
my customers suggested the idea of turning everything red/yellow/green
inside those JInternalFrames (that's what you're looking at in the example).
Of course one fool can ask more than a dozen of wise men can answer
and I am not that wise, so my question is: how would one change the
colour of all components that are part of a JInternalFrame (or any
other container) such that the colour wouldn't be 100% opague but
still visible by itself and still showing the information originally present
in each individual component. iow, as if a transparent monochrome
filter were positioned in front of that entire JContainer.
In a naive way I like the idea; if the idea turns out to be too complicated
to realize I'd be happy with visual alternatives also. (such as big arrows
pointing to the JContainer where the alarm happened).
Note that these appliations run in a 'factory' environment where people
either hardly watch the screens or they watch them at quite a great
distance. The changing colours should just attract their attention so they
will walk/run/drive/ride to the screens for a second inspection.
Any ideas are appreciated.
kind regards,
Jos

Not sure I understand the question, but I keyed in on:
as if a transparent monochrome filter were positioned in front of that entire JContainer.So maybe you could use a GlassPane:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GlassPaneTest extends JFrame
    public GlassPaneTest()
        final JComponent glassPane = new JComponent()
            public void paintComponent(Graphics g)
                g.setColor( getBackground() );
                g.fillRect(0, 0, getSize().width, getSize().height);
        glassPane.setOpaque( false );
        glassPane.setBackground( new Color(240, 20, 20, 100) );
        setGlassPane( glassPane );
        glassPane.addKeyListener( new KeyAdapter()
            public void keyPressed(KeyEvent e)
                e.consume();
        glassPane.addMouseListener( new MouseAdapter()
            public void mousePressed(MouseEvent e)
                e.consume();
        final JButton button = new JButton( "Click Me" );
        button.setMnemonic('c');
        button.addActionListener( new ActionListener()
            public void actionPerformed(ActionEvent e)
                   glassPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                   glassPane.setVisible( true );
                   glassPane.requestFocus();
                   Thread thread = new Thread()
                        public void run()
                            try { this.sleep(5000); }
                            catch (InterruptedException ie) {}
                             glassPane.setVisible( false );
                             glassPane.setCursor(null);
                thread.start();
        getContentPane().add(new JLabel("NORTH"), BorderLayout.NORTH );
        getContentPane().add( button );
        getContentPane().add(new JTextField(), BorderLayout.SOUTH);
    public static void main(String[] args)
        GlassPaneTest frame = new GlassPaneTest();
        frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
        frame.setSize(300, 300);
        frame.setLocationRelativeTo( null );
        frame.setVisible(true);
}The Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html]How to Use Glass Panes shows how you can also do a simple drawing (your arrow?) on the glass pane.

Similar Messages

  • EPICS alarm status is incorrect

    I am using LV2010SP1 with the DSC module and EPICS Server/Client. I have used EPICS in DSC before, but only for passing values. Now I am interested in alarms and alarm status and I am getting strange results. I have attached a zip file with  a project that illustrates the problem. The server publishes a single integer, and in DSC I enabled alarms with the default thresholds: below 10 is LOLO, 10-25 is LOW, 25-75 is NO_ALARM, 75-90 is HIGH and above 90 is HIHI. When I run the server and look at the values of the shared variable and the EPICS Server variable using Distributed Server Manager then everything looks good. On the client side, though, the alarm status readings are messed up. The status changes at the correct levels, but the status reads wrong. LOLO shows up as STATE, LOW shows up as COS, HIGH shows up as LOW and HIHI shows up as LOLO! STATE and COS are not even legitimate options for status. Here is a screen shot of the Distributed System Manager display. Has anyone else encountered this problem? I have tried Int16 and Int32 with the same results. I will try DBL next, but eventually I need this to work for integers.
    Rich
    Attachments:
    EPICS Alarms.zip ‏19 KB

    Rich:
    So, it turns out that COS and STATE are valid values for the STAT field in EPICS, but they definitely don't make sense for the alarm states of the bound shared variables.
    (Brief mention of some of the STAT field values can be found on aps.anl.gov here)
    I've filed this under Corrective Action Request (CAR) #297362 with R&D. In the meantime, is it possible to use the server's STAT value (instead of the client's) as a workaround?
    Caleb Harris
    National Instruments | Mechanical Engineer | http://www.ni.com/support

  • WCS Alarm Status shows green but LAP is unplugged ?! Oper Staus shows Down

    Hello,
    we are operating a Cisco WLAN environment with 1242 and 1131 LAP. Some of them have been converted from AP to LAP.
    Now we took some LAP off the wall.
    They are now packed in a box in our storage room.
    But the WCS is showing a green Alarm Status for these LAP and as Oper Status Down.
    How can that be ?
    Is there a way to fix this problem, because we want to see the Alarm Status in Red.
    Thx for all your input.
    Best Regards
    Christian

    This is very interesting. If I try to put myself in the WCS developer's shoes, I think:
    - if you get an alarm for missing AP, then acknowledge the alarm, WCS has no reason to re-display the same alarm. This is precisely what Acknowledge is for, to say "don't bother me with this issue anymore".
    - Even if you manually remove the AP from WCS, it clearly keeps some memory of it, at least for a while. This is something you can clearly see if you run a report of any kind, WCS has to keep track of objects even if you remove them.
    My suggestion would be:
    - Unacknowledge the alarm, then delete it... acknowledging an alarm is probably not the best way to deal with removing an AP. You would use Aknowledge for alarms such as "your neighbour AP keep being detected as rogue, you can't remove your neighbour AP but don't want to hear about this warning anymore." You acknowledge the alarm, WCS keeps it in its database and remembers NOT to bother you with it anymore (exactly what happens in your case).
    For an AP you remove, I would not acknowledge the alarm, but simply delete it after having removed the AP. This removes the alarm from the WCS database.
    If you ever re-plug this AP to the network, WCS may remember it, but any new alarm about it will display.
    Hope it helps
    Jerome

  • LabVIEW DSC: How to get alarm status from the area?

    Colleagues,
    I have, lets say, 50 Shared Variables where alarming enabled. Some of these variables assigned to area, so I can get status of the entire area or acknowledge an entire area of alarms (prior to version 8.x there was groups of the tags).
    Now I would like to get alarm status from the entire area. How can I do it?
    In version 6 I was able to wire tag group to Get Alarm Summary Status. Now, in version 8, Alarm Status.vi can be wired to the array of the variables, but not to area. Is it possible to get all variables from the area?
    regards,
    Andrey.

    I am not sure if I should be posting my problem under this particular topic. I am having trouble understanding acknowledge alarm vi and what this vi is supposed to do is not clear to me yet.
    I have around 300 shared variables in my project and I have created a particular vi just to view the alarms that may pop up during runs. I created a main menu and this alarm vi can be accessed upon a button click in the main menu. Users get alarm alert based on sound configuration. Then he can navigate to the alarm vi and acknowledge the alarm. The alarm vi only contains alarm and event display found under DSC module.
    The problem is everytime I click the alarm button in the main menu, it takes around 2 minutes for the alarm vi to update which is very annoying and unsatisfactory in the middle of run. I am not sure why it happens and I haven't got any response from support yet. These shared variables are managed under 10 different library files that are set up based on different loops of the process (flow, pressure and so on).
    Then I looked into three alarm examples that ship with DSC module. None of these examples use acknowledge alarm vi. I implemented another vi similar to alarm demo vi in that example - containing multicolumn listbox. I created acknowledge event containing acknowledge button and used the acknowledge alarm vi under this event. Read vi alarm is under timeout event.
    When I click the acknowledge button  as soon as I see the alarm in multicolumn listbox, nothing happens - the color of font does not get changed to purple neither any alarms get acknowledged. I tried to aknowledge alarm by variable name or  alarms or alarm area, it does not give me anything. What is this acknowledge alarm supposed to do? I tried to find examples everywhere in the web that uses this particular vi and haven't found one yet. 

  • I am having touble logging alarm status in labview

    I have written a vi that reads information from to data aquisition boards and compiles the info into a 1d boolean array(1x16) for its analog inputs and a 2d boolean array(9x23)for its digital inputs, I use a for loop and a case structure to index the arrays and return an alarm text if any of the booleans go HI. I want to display the alarm text on the front screen for each alarm that is Hi as well as save to disk and print. I have too small problems with my vi. Any alarms after the first one overwrite previouse alarm instead of adding to the current alarms, as well alarms continusly update making it impossible to save them as it would save every time the program cycles, I guess what I am asking is the
    re any way for the alarm status to be updated with each new alarm only and not updating untill it finds another change of state.
    thank you for any help or ideas
    drw

    For the alarm output, you can use shift registers and replace values if an alarm goes HI, letting the array pass trough if not. This way, only data passing to HI will write to the output, and won't overwrite it. You can save data everytime a bool goes high, so that only this makes data be saved. Attached there's a vi that gives some idea of what i mean.
    Hope this helps
    Attachments:
    alarm.llb ‏46 KB

  • View alarm status of shared variable

    Hello:
    I need to know the alarm status (I mean, if the shared variable is currently alarmed) of some shared variables hosted in a Compact Fieldpoint Controller.
    I've seached for options on how to do this (like searching for a property through a property node of the SharedVariableIO class) but haven't found a succesful method to do it.
    Anybody knows how to do that?
    Thanks in advance!
    Robst.
    Robst - CLD
    Using LabVIEW since version 7.0

      Hola Robst, para ver las propiedades de una variable lo que necesitas hacer es habilitar el porperty node para que acepte como entradas las constantes de Variables Compartidas. Para que property node acepte esta referencia como entrada tienes que decirle que en clase es una variable compartida. Para seleccionar la clase da clic derecho sobre el nodo, y ahí aparece en el menu class. Después selecciona Shared Variable. Una vez que tengas la Shared Variable vas a tener todas las propiedades, sin embargo aquí no hay una propiedad que diga si está o no activa la alarma este nodo más bien te permite saber la configuración de la alarma y modificarla.
    Aquí hay tres opciones sencillas para sacar esto. La primera es utiliza solo una variable y conectala al Read Alarms, o Alarm Status a partir de aquí puedes saber si existe o no alarmas.
    Con el de Read Alarms si el arreglo regresa vacio es que no hay alarmas. Con el de alarm Status hay una elemento del Cluster que te indica que si hay alguna alarma.
    Ahora otra opción es utilizar Read Alarms y de ahí extraer cuales son las alarmas.
    Saludos
    Message Edited by BeCeGa on 12-18-2008 05:43 PM
    Benjamin C
    Senior Systems Engineer // CLA // CLED // CTD
    Attachments:
    Alarmas2.PNG ‏21 KB
    Alarms Variables.vi ‏22 KB

  • How can I limit version status of Report or others components?

    How can I limit version status of Report or others components?
    If somebody knows please help.
    Thanks in advance.

    What exactly do you mean ?
    Do you mean you don't want the version number of the packaged components (e.g. forms reports etc) every time you make a change ?
    If that is the case then I don't think you can do that.
    You may be better served asking this question in the Portal Component Forum

  • Check alarm status using SNMP

    Hi,
    Is there a way to check if there is an active alarm on a cisco switch/router (M4900/4948 series and 2960 series) using SNMP ?
    I'm looking for a simple quick way to verify if an alarm is active (any alarm)
    is there some sort of general OID that gives me a '1' or '0' ?
    thanks !
    grtz
    Thijs

    Like a table that hold all alarms. No  there is no such thing.
    There are so many reasons there could be an alarm. Hardware state, error rates, utilisation, etc
    There are hardware state OID's that can give you a hardware component status.
    Usually you will find that you have an OID for a component, like a fan.
    1.3.6.1.4.1.9.9.13.1.4.1.3
    You can then walk this OID to find the instances of that OID.
    E.g, a fan for the device and another fan for the power supply, or a fan for each stack member.
    When you know these instances lets say the walk return .1001and .2004 you can query
    1.3.6.1.4.1.9.9.13.1.4.1.3.1001 and 1.3.6.1.4.1.9.9.13.1.4.1.3.2004.
    The values returned can be:
    Specific Object Information
    Object
    ciscoEnvMonFanState
    OID
    1.3.6.1.4.1.9.9.13.1.4.1.3
    Type
    CiscoEnvMonState
    1:normal
    2:warning
    3:critical
    4:shutdown
    5:notPresent
    6:notFunctioning
    Permission
    read-only
    Status
    current
    MIB
    CISCO-ENVMON-MIB ;   -   View Supporting Images
    Description
    The current state of the fan being instrumented.
    So then you have an alarm for the fan's.
    It is similar for other components like a power supply or temperature sensors, etc.
    http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&step=2&mibName=CISCO-ENVMON-MIB
    And then there are operational alarms not related to hardware.
    For this you need to monitor values like CPU utilization and define a threshold.
    Good luck,
    Michel

  • See alarm status at a glance?

    In iCal 3.0.2 I want to see at a glance if an event has an alarm set. On my Treo there is an alarm icon. Is there anything similar for iCal?
    Thanks!

    Apple.com/feedback

  • How to draw line to connect components dynamically??

    Dear Friends:
    I have following code is for drag/drop label, I hope to draw straight line to connect any TWO or more labels within this panel,
    [1]. keep all connected line
    [2]. can draw dynamically,
    I search quite a while with google, still very confused,
    Can any guru throw aome light how to do
    [1]. code 1:
    package swing.dnd;
    import java.awt.*;
    import javax.swing.*;
    public class TestDragComponent extends JFrame {
         public TestDragComponent() {
              super("Test");
              Container c = getContentPane();
              c.setLayout(new GridLayout(1,2));
              c.add(new MoveableComponentsContainer());
              c.add(new MoveableComponentsContainer());
              pack();
              setVisible(true);
         public static void main(String[] args) {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              catch (Exception ex) {
                   System.out.println(ex);
              new TestDragComponent();
    [2]. Code 2:
    package swing.dnd;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import java.awt.dnd.*;
    import java.awt.datatransfer.*;
    import java.awt.image.*;
    import java.awt.dnd.DragSource;
    import java.awt.dnd.DropTarget;
    public class MoveableComponentsContainer extends JPanel {     
         public DragSource dragSource;
         public DropTarget dropTarget;
         private static BufferedImage buffImage = null; //buff image
         private static Point cursorPoint = new Point();
         public MoveableComponentsContainer() {
              setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.white, Color.gray));
              setLayout(null);
              dragSource = new DragSource();
              ComponentDragSourceListener tdsl = new ComponentDragSourceListener();
              dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, new ComponentDragGestureListener(tdsl));
              ComponentDropTargetListener tdtl = new ComponentDropTargetListener();
              dropTarget = new DropTarget(this, DnDConstants.ACTION_MOVE, tdtl);
              setPreferredSize(new Dimension(400,400));
              addMoveableComponents();
         private void addMoveableComponents() {
              MoveableLabel lab = new MoveableLabel("label 1");
              add(lab);
              lab.setLocation(10,10);
              lab = new MoveableLabel("label 2");
              add(lab);
              lab.setLocation(40,40);
              lab = new MoveableLabel("label 3");
              add(lab);
              lab.setLocation(70,70);
              lab = new MoveableLabel("label 4");
              add(lab);
              lab.setLocation(100,100);
         final class ComponentDragSourceListener implements DragSourceListener {
              public void dragDropEnd(DragSourceDropEvent dsde) {
              public void dragEnter(DragSourceDragEvent dsde)  {
                   int action = dsde.getDropAction();
                   if (action == DnDConstants.ACTION_MOVE) {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
                   else {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
              public void dragOver(DragSourceDragEvent dsde) {
                   int action = dsde.getDropAction();
                   if (action == DnDConstants.ACTION_MOVE) {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
                   else {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
              public void dropActionChanged(DragSourceDragEvent dsde)  {
                   int action = dsde.getDropAction();
                   if (action == DnDConstants.ACTION_MOVE) {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
                   else {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
              public void dragExit(DragSourceEvent dse) {
                 dse.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
         final class ComponentDragGestureListener implements DragGestureListener {
              ComponentDragSourceListener tdsl;
              public ComponentDragGestureListener(ComponentDragSourceListener tdsl) {
                   this.tdsl = tdsl;
              public void dragGestureRecognized(DragGestureEvent dge) {
                   Component comp = getComponentAt(dge.getDragOrigin());
                   if (comp != null && comp != MoveableComponentsContainer.this) {
                        cursorPoint.setLocation(SwingUtilities.convertPoint(MoveableComponentsContainer.this, dge.getDragOrigin(), comp));
                        buffImage = new BufferedImage(comp.getWidth(), comp.getHeight(), java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE);//buffered image reference passing the label's ht and width
                        Graphics2D graphics = buffImage.createGraphics();//creating the graphics for buffered image
                        graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));     //Sets the Composite for the Graphics2D context
                        boolean opacity = ((JComponent)comp).isOpaque();
                        if (opacity) {
                             ((JComponent)comp).setOpaque(false);                         
                        comp.paint(graphics); //painting the graphics to label
                        if (opacity) {
                             ((JComponent)comp).setOpaque(true);                         
                        graphics.dispose();
                        remove(comp);
                        dragSource.startDrag(dge, DragSource.DefaultMoveDrop , buffImage, cursorPoint, new TransferableComponent(comp), tdsl);     
                        revalidate();
                        repaint();
         final class ComponentDropTargetListener implements DropTargetListener {
              private Rectangle rect2D = new Rectangle();
              Insets insets;
              public void dragEnter(DropTargetDragEvent dtde) {
                   Point pt = dtde.getLocation();
                   paintImmediately(rect2D.getBounds());
                   rect2D.setRect((int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),buffImage.getWidth(),buffImage.getHeight());
                   ((Graphics2D) getGraphics()).drawImage(buffImage,(int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),MoveableComponentsContainer.this);
                   dtde.acceptDrag(dtde.getDropAction());
              public void dragExit(DropTargetEvent dte) {
                   paintImmediately(rect2D.getBounds());
              public void dragOver(DropTargetDragEvent dtde) {
                   Point pt = dtde.getLocation();
                   paintImmediately(rect2D.getBounds());
                   rect2D.setRect((int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),buffImage.getWidth(),buffImage.getHeight());
                   ((Graphics2D) getGraphics()).drawImage(buffImage,(int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),MoveableComponentsContainer.this);
                   dtde.acceptDrag(dtde.getDropAction());
              public void dropActionChanged(DropTargetDragEvent dtde) {
                   Point pt = dtde.getLocation();
                   paintImmediately(rect2D.getBounds());
                   rect2D.setRect((int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),buffImage.getWidth(),buffImage.getHeight());
                   ((Graphics2D) getGraphics()).drawImage(buffImage,(int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),MoveableComponentsContainer.this);
                   dtde.acceptDrag(dtde.getDropAction());
              public void drop(DropTargetDropEvent dtde) {
                   try {
                        paintImmediately(rect2D.getBounds());
                        int action = dtde.getDropAction();
                        Transferable transferable = dtde.getTransferable();
                        if (transferable.isDataFlavorSupported(TransferableComponent.COMPONENT_FLAVOR)) {
                             Component comp = (Component) transferable.getTransferData(TransferableComponent.COMPONENT_FLAVOR);
                             Point location = dtde.getLocation();
                             if (comp == null) {
                                  dtde.rejectDrop();
                                  dtde.dropComplete(false);
                                  revalidate();
                                  repaint();
                                  return;                              
                             else {                         
                                  add(comp, 0);
                                  comp.setLocation((int)(location.getX()-cursorPoint.getX()),(int)(location.getY()-cursorPoint.getY()));
                                  dtde.dropComplete(true);
                                  revalidate();
                                  repaint();
                                  return;
                        else {
                             dtde.rejectDrop();
                             dtde.dropComplete(false);
                             return;               
                   catch (Exception e) {     
                        System.out.println(e);
                        dtde.rejectDrop();
                        dtde.dropComplete(false);
    Thanks so much for any help.
    Reagrds
    sunny

    Craig Wood's code here might do what you want
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=2&t=015259

  • Skin is drawing on top of components

    I have a skin with HostComponent of SkinnableContainer. It looks like this:
    <s:BitmapImage source="@Embed(source='/img/skinGraphics/footer.png')" />
        <s:Group id="contentGroup">
        </s:Group>
    The skinnable container looks like this:
    <s:SkinnableContainer>
         <s:HGroup width="1000">
            <s:HGroup width="100%"  height="100%" top="4" horizontalAlign="left" id="leftBtnGroup"/>   
            <s:HGroup height="100%" top="4" horizontalAlign="right" id="rightBtnGroup" />
        </s:HGroup>
    </s:SkinnableContainer>
    I dynamically add some buttons to the leftBtnGroup and the rightBtnGroup and they are being drawn behind the footer.png image. What am I doing wrong?
    Thanks..

    The footer is contained within the main view UI like this:
    <s:SkinnableContainer skinClass="skins.BPSApplicationSkinGrey">
            <s:layout>
                <s:VerticalLayout />
            </s:layout>
            <view:TitleBar theModuleTitle="{breadCrumbStr}" top="43" left="0"/>
            <views:TestView id="testView" includeIn="TestView"/>
            <views:TestBrowser id="testBrowser" includeIn="TestBrowser"/>
            <com:Footer id="footer" bottom="8"/>
        </s:SkinnableContainer>
    The buttons are attached on the enterState() function of testBroswer.
    public function enterState():void{
                    btnDelete = new Button();
                    btnDelete.setStyle("skinClass", skins.FooterButtonGreenSkin);
                    btnDelete.addEventListener(MouseEvent.CLICK, deleteBtnClickHandler);
                    parentDocument.footer.addLeftButton(btnDelete);
                    btnDelete.label = "DELETE TEST";
    public function addLeftButton(btn:Button):void{
                    leftBtnGroup.addElement(btn);

  • JInternalFrame drawing problem.

    Hi gurus
    Please could you help with a java problem that I cant find an answer to over the net:
    I have a JDesktop which contains multiple JInternalFrames. On one JInternalFrame i have attached a JPanel on which to draw on. I have multiple threads (simple ball shapes) that need to be drawn onto the JPanel and have left it up to the indivual threads to draw themselves (as opposed to using paintComponent in the JPanel class). The drawing on the JInternalFrame works perfectly fine.
    The problem arises when the other JInternalFrames are placed on top of each other - the balls are drawn over the top most JInternalFrame. What am i doing wrong? I have attached snippets of the code:
    public class Desktop extends JFrame implements ActionListener
              public Desktop()
                        setTitle("Agent's world");
                        setSize(w,h);
                        setDefaultCloseOperation(EXIT_ON_CLOSE);
                        JDesktopPane desktop = new JDesktopPane();
                        setContentPane(desktop);
                        /************* Agent *************/
                        JInternalFrame agents = new JInternalFrame("Agents War", true, false, true, false);                    
                        agents.reshape(0,0,(int)((w/3)*2),h);
                        Container contentPane = agents.getContentPane();
                        canvas = new AgentPanel(agents);
                        contentPane.add(canvas);
                        /************* Button *************/
                        JPanel buttonPanel = new JPanel();
                        ButtonGroup buttonGroup = new ButtonGroup();
                        JButton start = new JButton("START");
                        start.addActionListener(this);
                        buttonPanel.add(start);
                        contentPane.add(buttonPanel, "North");
                        agents.setVisible(true);
                        desktop.add(agents);
                        //sets focus to other frames within the desktop
                        try
                                  agents.setSelected(true);
                        catch(PropertyVetoException e)
                                  //attempt to refocus was vetoed by a frame
              /** Method to listen for event actions, i.e. button clicks **/
         public void actionPerformed(ActionEvent event)
                   //passes through 'this' to allow access to the getList method
                   Agents agent = new Agents(canvas, this);
                   agent.start();
    public class Agents extends Thread
              public Agents(AgentPanel panel, Desktop desktop)
                        panel =_panel;
                        desktop = _desktop;
                        setDaemon(true);
    /** Moves the agent from a spefic position to a new position **/
              public void move()
                        Graphics g = panel.getGraphics();
                        Graphics2D g2 = (Graphics2D)g;
                        try
                                  //set XOR mode
                                  g.setXORMode(panel.getBackground());
                                  //draw over old
                                  Ellipse2D.Double ballOld = new Ellipse2D.Double(i , j, length, length);
                                  g2.fill(ballOld);     
                                  i++;
                                  j++;
                                  if(flag == true)
                                            //draw new
                                            Ellipse2D.Double ballNew = new Ellipse2D.Double(i , j, length, length);
                                            g2.fill(ballNew);
                                            g2.setPaintMode();
                        finally
                                  g.dispose();
              /** Activates the Thread **/
              public void run()
                   int i = 0;
                   while(!interrupted() && i<100)
                        try
                                       for(i = 0 ; i <100 ; i++)
                                                 //draw ball in old position                                             move();          
                                                 sleep(100);                              
                             catch(InterruptedException e)
    public class AgentPanel extends JPanel
              /** local copy of internal frame */
              private JInternalFrame frame;
              public AgentPanel(JInternalFrame _frame)
                        frame = _frame;
                        setSize(frame.getWidth(), frame.getHeight());
                        setBackground(Color.white);          
              public void paintComponent(Graphics g)
                        super.paintComponent(g);
    Thank you in advance.
    Ravs

    I have the same problem. Seems to be a bug. See:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=231037
    Bummer.

  • Display the status of parallel human tasks in ADF web page (BPM 11g)

    Hi,
    We create a BPMN process (BPM 11g) which splits into parallel branches. Each branch has its own user activity. We want to show the task status of ALL the parallel user activities (running or completed) in the ADF web page implemented for the user activity so the user would have the whole picture of the process.
    In another words, we are able to check the status of the component instances associated with the process instance in the Oracle EM. We want to provide the similar information (in our case, we only want to show the status of the human task components) to the user when they access the human task page.
    I wonder if the only solution is to write Java code with the API to lookup the BPMN process instance. We try to avoid Java coding if possible. Please advise. Also, so far, I have not found any complete instruction/document on how to access the BPMN process instance and check the tasks etc. through the API. Please help if you know where I could get such information.
    Thanks a lot,
    Helen

    sorry!!
    http://www.esnips.com/doc/dca05e99-d5ca-49ce-80c8-5bedfe27a24a/screenshot-2

  • Coreapplication shows as down in OEM, but all components are up

    Hi,.
    Just upgraded from 11.1.1.5 to 11.1.1.6.2. All went fine and everything running. Also upgraded WLS from 10.3.5 to 10.3.6
    Yet the core application shows as down in OEM although system status reads      All components are available
    weird .....
    diagnostic logs show failed to get status for java components so looks like the console isnt communicating with opmn correctly? Not sure. Everything is running out of the same box except the database.
    admin server log presents:
    Failed to get status of all of OPMN components for one or more Oracle Instances of BI instance: coreapplication
    Any bright ideas please ping them this way!
    THanks
    Edited by: 869150 on 23-Jul-2012 06:20

    SR 3-5707809851 : Managed components missing from diagnostics after 11.1.1.5 to 11.1.1.6 in-place upgrade ==> Bug 14111737; fixed in 11.1.1.7.0.

  • Change Alarm / Quality of Shared Variables for I/O Server

    How does one set the Bad Status of a Shared Variable in 2009?
    IE).  I have a custom device that communicates via TCP/IP.  I wrote my own I/O server that handles this communication and publishes a set of Shared Variables that my Main Application displays on a screen.  These variables are all doubles and hold pressures and temperatures.   If my I/O server in labview loses communication I would like to be able to set the status of the variables to bad so they will set off an alarm.  In our main application we have colour indicators that are able to display this status.  For example the background goes yellow for all indicators that are in "HI" alarm status, red in "HI HI" and orange when "Bad Status" (disconnected). 
    We were able to accomplish this using LabVIEW 7.1 DSC, by creating a VI to register all our "Tags" and a VI to run the server.  The server vi's that came with 7.1 allowed us to set the quality when writing to the server item.  Therefore when the device was disconnected or failed we could set the bad status and use the DSC system to log an alarm and use the alarm features to colour code our indicators. 

    None of the Shared Variable IO Properties can be configured to allow you to set the alarm.  You can only configure the properties such as turning the possibility of the alarm status on/off and the priority, name etc.  You do not have the ability to indicate that this shared variable is in alarm because your custom server has encountered a problem.   I've talked to tech support about it and I've been informed that this was something that was removed when the shared variable engine was introduced.   I've been told informed that the recommended alternative is to create an additional boolean shared variable that will contain the status of the items, or to write some sort of unique garbage value to the actual tag value to indicate there is a problem with it.
    I now have to come up with a new way of providing this information.  I just find it will likely be a poor programming choice because now my entire system will have to handle "tags" differently based on what hardware is being used.  (IE) if its coming from a custom I/O device or from an OPC / Modbus etc capable device. 

Maybe you are looking for

  • .orf file recognition

    I have Lightroom 3.6 and have just acquired a new Olympus EM-5.  Problem with .orf file recognition on my first download of test shots.  Any help?

  • Powerbook 17" and PDFs

    My wife's 17" Powerbook creates pdf shortcuts on the desktop whenever she goes to a site on the web. How would I go in and stop this from happening? Thanks. Barrister

  • Daily User Stats of users log on for the Day

    Im need stats of users log on for the previous days on the system. Ive been to transation suim but I get stats on the users last logon. I require stats on a day to day basis so that I can anaylze how many users log on every day. Thank you [email prot

  • Will a dive enclosure (or flat lens) be offered for the hdr-az1?

    I recently bought the hdr-az1 at Best Buy.  I had originally gone in to buy a GoPro, but was convinced that the Sony was the better option by the sales associate.  He also assured me that most of the peripherals that the GoPro has, Sony also offers,

  • How do i know if my apple tv's software is up to date?

    I would like to show a you tube vedio from my Macbook on my tv