1

[This question is in relation to this question]

Setting: I have this home-crafted "editable label" component which looks like a label, but when you click it, it turns into an editable field, allowing you to edit it. You can hit Esc to cancel, or Shift-Enter to OK your edits - or click the respective buttons beneath the editable field.

The Challenge: When hitting edit, I want the entire UI to be "whited out", except for the edit-label's area, to clearly denote to the user where it is expected that he should focus.

Community
  • 1
  • 1
stolsvik
  • 5,253
  • 7
  • 43
  • 52
  • It seems to me there are much easier ways of drawing the user's attention to the edit label than whiting out the entire GUI, couldn't you just draw a red border around the component instead? – Dónal Aug 30 '10 at 11:54
  • @Don: Well, yes, but the challenge is pretty much exactly the same whether you draw a ring around it, or whiteout/fadeout/blur the rest.. – stolsvik Aug 30 '10 at 12:25
  • 2
    Just a note of caution... I've found interfaces that perform this sort of focus grabbing are almost completely unusable over Remote Desktop due to the large delays introduced by repainting the screen multiple times. It's even **worse** if the affect fades in and out. Pure agony. ;-) – Chris Nava Aug 30 '10 at 14:07
  • @stolscik - I don't think so. If you want to whiteout the rest of the GUI you need to change the appearance of multiple components, but using the approach I suggested you only need to change the appearance of one component – Dónal Aug 30 '10 at 14:17

2 Answers2

2

Alternative, this could be achieved using the JXLayer project. Take a look at some of their demos where they blur out the GUI when an item is selected. You would have to implement your own JXLayer view in order to white out your GUI.

Project URL: https://jxlayer.dev.java.net/

Demos are under the "getting started" item on the front page.

Andy
  • 5,108
  • 3
  • 26
  • 37
  • I saw your comment below. Regarding resizing, I believe once you get the view set up with the whiteout effect JXLayer would, by nature, take care window resizing and repainting. This assumes your whiteout view queries the current component sizes/positions in order to figure out what area no to whiteout. – Andy Aug 30 '10 at 16:58
1

You could take a look at possible usages of the glass pane ...

UPDATED due to question author's comment.

This kind of problemn is typically solved by a personnal implementation of Look'n'Feel.

Typically, the component requiring the screen will have a client property set for that purpose. The LnF, which has created a rendering compoent for that component, has also registered a listenr. When this property is set, an event is fired by component, that LnF will receive. At event reception, a glass pane is then installed over the whole container frame.

Riduidel
  • 22,052
  • 14
  • 85
  • 185
  • Thanks, and yes I agree. And also look at JXLayer. However, I was hoping for some ideas for what "architecture" to use to do such decoration. A central "Highlight manager" that all these components register to? What about repaint and resizes? Resize of the component, or of the window, while in the hightlight-mode? – stolsvik Aug 30 '10 at 12:28