Page 1 of 2 12 LastLast
Results 1 to 20 of 33
  1. #1
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Look and Feel question

    Greetings,

    Imagine 32 burglar alarm units and 127 people who need to be notified if one or more of those units raise an alarm situation. Basically this can be modelled as 127x32 bits or booleans. Sometimes people don't (or do) want to be notified for certain burglar alarm notifications. So that 127x32 table changes; If I present that table as a (big) JTable it looks like a huge old fashioned telephone switch board; I have no problems with the model of this all, nor with the actual notifications etc. It's just that I have no idea how to present this 127x32 table to the human operator of this all.

    The huge JTable is a nono (imho) ; showing 32 alarms for a single (selected) user also doesn't look good; ideas anyone?

    kind regards,

    Jos (<-- clumsy when it comes to that visualization stuff)

    ps. those 127 people can be individuals or police stations. Finally there are going to be many more burglar alarms but this is a start for a single 'notification broadcast centre (a small embedded device)'.
    cenosillicaphobia: the fear for an empty beer glass

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,686
    Rep Power
    5

    Default Re: Look and Feel question

    What have you got? Where are you stuck? (couldn't resist)

    I'd probably go down a custom painting road and not use a clunky JTable. Then I'd draw the table built out of bordered tiles and make the squares light gray when everything is okay and draw maybe a red alert icon in one when an alarm goes off.

    edit: this sounds like a cool project btw.
    Last edited by gimbal2; 09-24-2013 at 09:12 AM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: Look and Feel question

    Quote Originally Posted by gimbal2 View Post
    What have you got? Where are you stuck? (couldn't resist)

    I'd probably go down a custom painting road and not use a clunky JTable. Then I'd draw the table built out of bordered tiles and make the squares light gray when everything is okay and draw maybe a red alert icon in one when an alarm goes off.

    edit: this sounds like a cool project btw.
    There's no need to show actual notifications; just that police station X needs to be notified if burglar alarm Y raises an alarm situation. There are 127 Xs and 32 Ys; If I show 127x32 JCheckBoxes in a JTable it looks huge (too huge). The actual notifications are SMS messages (I'm still fiddling with an IM system, but that's stil a mess ;-) I'm looking for another way to present that 127x32 table but I lack any visual designer skills ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,686
    Rep Power
    5

    Default Re: Look and Feel question

    You can't make a huge table look 'nice' (read: not confusing) unless you start to add lots of spacing to it with carefully picked coloring and put it on a huge screen, IMO. If you make it too cramped with no clear visual separation between the elements, it just becomes one blur that the brain has difficulty to interpret.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: Look and Feel question

    It would be involved, but how about a simple programatically drawn graphic and a mouse listener?

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: Look and Feel question

    Quote Originally Posted by masijade View Post
    It would be involved, but how about a simple programatically drawn graphic and a mouse listener?
    I've been thinking about that: 127 nodes on the left/top and 32 nodes near the bottom/right side of the window. Lines would connect nodes on the left/top to the nodes at the bottom/right; it looks like a spider web ;-) Or isn't this what you had in mind?

    kind regards,

    Jos

    ps. They're lecturing 'data visualisation' in Eindhoven university nowadays (it didn't even exist in my days); I might have a peek there ...
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,686
    Rep Power
    5

    Default Re: Look and Feel question

    That's probably more to do with big data, statistics and reporting, but perhaps I'm wrong :)

    I would draw up a few mockups if I were you to at least see what is in your mind. If you put it in writing it is up to the imagination of the reader.


    EDIT: the last one you pitched would become far less of a spiderweb if the lines only appear when you click one of the 127 nodes. But it will probably still be a huge mess.
    Last edited by gimbal2; 09-24-2013 at 10:46 AM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: Look and Feel question

    Currently I'm playing with the following idea: select one of the 127 phone numbers (police stations etc.) next to it are the 32 burglar alarm IDs (displayed as a, say, 4x8 block of IDs) You can (un)mark each of the IDs, stating that a particular person does/doesn't want to be notified for a particular burglar alarm. This way it doesn't look so 'massive' ... but I lose 'context' information, e.g. what stations are notified for a particular burglar alarm; maybe I need another view for it. The model is a simple 127x32 table after all and with those views one can view an intersection of it (a single row or column)' hm, it might be worth giving it a try ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: Look and Feel question

    Quote Originally Posted by JosAH View Post
    I've been thinking about that: 127 nodes on the left/top and 32 nodes near the bottom/right side of the window. Lines would connect nodes on the left/top to the nodes at the bottom/right; it looks like a spider web ;-) Or isn't this what you had in mind?

    kind regards,

    Jos

    ps. They're lecturing 'data visualisation' in Eindhoven university nowadays (it didn't even exist in my days); I might have a peek there ...

    That is one way, my initial thought was a simple square grid, like a table, but simply much more compressed.

  10. #10
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,384
    Rep Power
    5

    Default Re: Look and Feel question

    It appears that this will even get more busy since you will need to add more alarms and the labels on the Y columns will need to be almost vertical or it wouldn't fit. Assuming that this is just to show who is notified on what alarm why not have say some number of continuously scrolling windows (sort of cyclical scrolling). It could be organized in a variety of ways. But you could have four (or more) windows each scrolling the same info but starting at some different point in an alphabetized list. The info could be colored depending on whether the person or site is notified or not. It's a matter of how long someone can wait to determine if an alarm is being handled.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: Look and Feel question

    Quote Originally Posted by jim829 View Post
    It appears that this will even get more busy since you will need to add more alarms and the labels on the Y columns will need to be almost vertical or it wouldn't fit. Assuming that this is just to show who is notified on what alarm why not have say some number of continuously scrolling windows (sort of cyclical scrolling). It could be organized in a variety of ways. But you could have four (or more) windows each scrolling the same info but starting at some different point in an alphabetized list. The info could be colored depending on whether the person or site is notified or not. It's a matter of how long someone can wait to determine if an alarm is being handled.
    It sounds nice, but what to do if a user wants to add or delete an entry from that 127x32 table? This afternoon I cooked something up: in a list of 127 entries you can right click and it shows the list of 32 burglar alarms (in a 8x4 gridlayout in another dialog); and you can add or delete that particular entry from the 127 element list to/from the alarm list; I have to play with it a bit more ... It took me the entire afternoon to implement this; I'm sooo slow when it comes to those visual Swing components. Why can't users enter simple functional expressions like every sensible grown up human being?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  12. #12
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,384
    Rep Power
    5

    Default Re: Look and Feel question

    I guess I didn't realize this was the way notifications were added. I thought is was for information purposes.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  13. #13
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: Look and Feel question

    Quote Originally Posted by jim829 View Post
    I guess I didn't realize this was the way notifications were added. I thought is was for information purposes.
    I guess I was unclear again: individuals and police stations (may) want to be notified (there are 127 of them) if one or more of 32 burglar alarms raise an alarm condition. Thet 'subscribe' to an alarm unit so to speak. This makes up the 127x32 table/bit matrix. Those subscriptions can change (e.g. a police station has a doughnut party, so they're unavailable); I want to make that (un)subscription process visually
    intuitive; showing the entire 127x32 table is intimidating; that's why I raised my question, the actual notification (using the sms protocol) works fine.

    b.t.w. if you know of a proper IM implementation over 'teh net' (not whatsapp or other crapola, I mean with a proper API) drop me a note.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  14. #14
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,384
    Rep Power
    5

    Default Re: Look and Feel question

    This reminds me of a Network Management Center. Where one has a network topology map used to manage and monitor network activity. It is impossible to show everything on the map at once because it would be too cluttered. So just section alarms or notifications are raised when status changes. Then the operators must drill down to a finer granularity to get more specific info. This is always accompanied by some other status log which constantly scrolls interfaces as up or down. Adding new network components to monitor is done in an auxiliary management panel.

    If this is hanging on a wall somewhere, then I am not certain you can have a instant view of who responds to what unless you display the 127 x 32 grid. If it is simply an operator, then some user intervention may be required.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  15. #15
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Look and Feel question

    Here's an idea, using JLists. Note: (1) if using Java 7, JList is generic so cast to String won't be needed and (2) I do know that parallel arrays (or ArrayLists) are evil; that's just me being lazy in the modeling of the data.

    This could have buttons and/or drag/drop for swapping between the two lists of Alarms.
    Java Code:
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    import javax.swing.event.*;
    
    public class JosAlarms {
    
      private List<String> stations = new ArrayList<String>();
      private List<String> alarms = new ArrayList<String>();
      private List<List<Boolean>> mappings = new ArrayList<List<Boolean>>();
      private int stationCount;
      private int alarmCount;
      private TitledList allStationsList;
      private TitledList subscribedAlarmList;
      private TitledList unsubscribedAlarmList;
      private TitledList alsoSubscribedStationList;
      private Random random = new Random();
    
      public JosAlarms(int stationCount, int alarmCount) {
        this.stationCount = stationCount;
        this.alarmCount = alarmCount;
      }
    
      public static void main(String[] args) throws Exception {
        SwingUtilities.invokeLater(new Runnable() {
    
          @Override
          public void run() {
            new JosAlarms(127, 32).makeUI();
          }
        });
      }
    
      private void makeUI() {
        populate();
        allStationsList = new TitledList("All Stations");
        allStationsList.setData(stations);
        final JList allStationsJList = allStationsList.getList();
        allStationsJList.addListSelectionListener(new ListSelectionListener() {
    
          @Override
          public void valueChanged(ListSelectionEvent e) {
            if (!allStationsJList.getValueIsAdjusting()
                    && allStationsJList.getSelectedIndex() > -1) {
              String station = (String) allStationsJList.getSelectedValue();
              int index = stations.indexOf(station);
              rebuildAlarmLists(index);
            }
          }
        });
    
        ListSelectionListener alarmSelectionListener = new ListSelectionListener() {
    
          @Override
          public void valueChanged(ListSelectionEvent e) {
            JList list = (JList) e.getSource();
            if (!list.getValueIsAdjusting() && list.getSelectedIndex() > -1) {
              String alarm = (String) list.getSelectedValue();
              int index = alarms.indexOf(alarm);
              rebuildAlsoSubscribedStationsList(index);
            }
          }
        };
        FocusListener focusListener = new FocusAdapter() {
    
          @Override
          public void focusLost(FocusEvent e) {
            JList list = (JList) e.getSource();
            list.clearSelection();
          }
        };
        subscribedAlarmList = new TitledList("Subscribed Alarms");
        JList subscribedAlarmJList = subscribedAlarmList.getList();
    
        subscribedAlarmJList.addListSelectionListener(alarmSelectionListener);
    
        subscribedAlarmJList.addFocusListener(focusListener);
        unsubscribedAlarmList = new TitledList("Unsubscribed Alarms");
        JList unsubscribedAlarmJList = unsubscribedAlarmList.getList();
    
        unsubscribedAlarmJList.addListSelectionListener(alarmSelectionListener);
    
        unsubscribedAlarmJList.addFocusListener(focusListener);
        alsoSubscribedStationList = new TitledList("Also subscribed");
        JList alsoSubscribedStationJList = alsoSubscribedStationList.getList();
        alsoSubscribedStationJList.setEnabled(false);
    
        JPanel panel = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1;
        gbc.weighty = 1;
    
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridheight = 2;
        panel.add(new JScrollPane(allStationsJList), gbc);
    
        gbc.gridx = 1;
        gbc.gridheight = 1;
        panel.add(new JScrollPane(subscribedAlarmJList), gbc);
    
        gbc.gridy = 1;
        panel.add(new JScrollPane(unsubscribedAlarmJList), gbc);
    
        gbc.gridx = 2;
        gbc.gridy = 0;
        gbc.gridheight = 2;
        panel.add(new JScrollPane(alsoSubscribedStationJList), gbc);
    
        JFrame frame = new JFrame();
        frame.add(panel);
    
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(
                800, 600);
        frame.setLocationRelativeTo(
                null);
        frame.setVisible(
                true);
      }
    
      private void populate() {
        for (int i = 0; i < alarmCount; i++) {
          alarms.add("Alarm " + i);
        }
        for (int i = 0; i < stationCount; i++) {
          stations.add("Station " + i);
          List<Boolean> mapping = new ArrayList<Boolean>();
    
          for (int j = 0; j < alarmCount; j++) {
            mapping.add(random.nextBoolean());
          }
          mappings.add(mapping);
        }
      }
    
      private void rebuildAlarmLists(int index) {
        List<String> subscribedAlarms = new ArrayList<String>();
        List<String> unsubscribedAlarms = new ArrayList<String>();
        List<Boolean> mapping = mappings.get(index);
        for (int i = 0; i < mapping.size(); i++) {
          if (mapping.get(i)) {
            subscribedAlarms.add(alarms.get(i));
          } else {
            unsubscribedAlarms.add(alarms.get(i));
          }
        }
        subscribedAlarmList.setData(subscribedAlarms);
        unsubscribedAlarmList.setData(unsubscribedAlarms);
      }
    
      private void rebuildAlsoSubscribedStationsList(int index) {
        List<String> alsoSubscribed = new ArrayList<String>();
    
        for (int i = 0; i < mappings.size(); i++) {
          if (mappings.get(i).get(index)) {
            alsoSubscribed.add(stations.get(i));
          }
        }
        alsoSubscribedStationList.setTitle("Also subscribed to " + alarms.get(index));
        alsoSubscribedStationList.setData(alsoSubscribed);
      }
    }
    
    class TitledList {
    
      private DefaultListModel model = new DefaultListModel();
      private TitledBorder border;
      private final JList list = new JList();
    
      public TitledList(String title) {
        border = new TitledBorder(title);
        list.setBorder(border);
      }
    
      public void setTitle(String title) {
        border.setTitle(title);
      }
    
      public void setData(List<String> data) {
        model = new DefaultListModel();
        for (String element : data) {
          model.addElement(element);
        }
        list.setModel(model);
      }
    
      public void add(String element) {
        model.addElement(element);
      }
    
      public void remove(String element) {
        model.removeElement(element);
      }
    
      public JList getList() {
        return list;
      }
    }
    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  16. #16
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,686
    Rep Power
    5

    Default Re: Look and Feel question

    Quote Originally Posted by JosAH View Post
    b.t.w. if you know of a proper IM implementation over 'teh net' (not whatsapp or other crapola, I mean with a proper API) drop me a note.
    Anything XMPP based. This looks interesting:

    Ignite Realtime: Smack API
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  17. #17
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: Look and Feel question

    Quote Originally Posted by DarrylBurke View Post
    Here's an idea, using JLists. Note: (1) if using Java 7, JList is generic so cast to String won't be needed and (2) I do know that parallel arrays (or ArrayLists) are evil; that's just me being lazy in the modeling of the data.

    This could have buttons and/or drag/drop for swapping between the two lists of Alarms.[code]import java.awt.GridBagConstraints;
    This is so cool; I just copied your code over to Eclipse and I really like it; I foresee IndexOutOfBounds exceptions because my model is stored in EEPROM in a small embedded device as a block (1/2KB) of bits: 32x128 bits and I regularly make mistakes about which index is what ;-) I added a right click mouse event on the (un)subsribed lists and it simply toggles the subscription of the current station for the selected burglar alarm; it works as a breeze; thanks a ton, this is much better than what I had cooked up.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  18. #18
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,686
    Rep Power
    5

    Default Re: Look and Feel question

    I would have NEVER gotten to a design like that from what I've read here. That's some serious thinking outside of the box. Who needs a matrix? Combine several lists!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  19. #19
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: Look and Feel question

    Quote Originally Posted by gimbal2 View Post
    I would have NEVER gotten to a design like that from what I've read here. That's some serious thinking outside of the box. Who needs a matrix? Combine several lists!
    Well, that 'mappings' list does contain the entire (bit) matrix. I prefer to mentally visualize it as a matrix with 127 rows and 32 columns. The list on the left runs alongside the rows of the matrix while the two lists in the middle represent a single row of the matrix. The list on the right represents a column of the matrix where the entires are 1 (true). I like it.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  20. #20
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,384
    Rep Power
    5

    Default Re: Look and Feel question

    Well, that answers my question about allowing user intervention. If you are allowed to click on a GUI rather than rely on the status manifesting itself without intervention, then that does open up more design possibilities.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 6
    Last Post: 01-14-2012, 03:21 AM
  2. simple question feel stupid asking...
    By IYIaster in forum New To Java
    Replies: 3
    Last Post: 10-02-2009, 05:04 PM
  3. Look and Feel
    By arun_kumar in forum AWT / Swing
    Replies: 1
    Last Post: 11-17-2007, 06:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •