Closed GoogleCodeExporter closed 9 years ago
You can in fact access the iApp style scoll bar delegates via the following
methods:
IAppWidgetFactory.createVerticalScrollBarButtonsTogetherUI()
IAppWidgetFactory.createHorizontalScrollBarButtonsTogetherUI()
Does this meet your needs?
Original comment by kenneth....@gmail.com
on 22 Dec 2008 at 12:25
I haven't heard back on this one, and I think I'm meeting this use-case, so I'm
closing this issue.
Original comment by kenneth....@gmail.com
on 30 Dec 2008 at 6:27
Sorry for not getting back earlier.
What's needed is a class that inherits from BasicScrollBarUI and does all the
iapp scrollbar stuff magically. That
way one only registers it with UIManager and is done. Right now I have to find
every place in my code where I
might use a scrollbar and call those methods.
Original comment by hendrik....@gmail.com
on 30 Dec 2008 at 6:41
IAppWidgetFactory.createVerticalScrollBarButtonsTogetherUI() and
IAppWidgetFactory.createHorizontalScrollBarButtonsTogetherUI() do return
ScrollBarUIs. How were you going
to register the UI delegates with the UIDefaults? I'm not aware of a clean way
in Swing to specify an alternate
UI delegate for a particular type of JComponent that already has a UI provided
by the L&F. You could of course
delve into the Multi-L&F, though I don't know if even that would work.
Note that I don't plan on providing a full L&F.
Have I missed something?
Original comment by kenneth....@gmail.com
on 30 Dec 2008 at 7:01
Not that it looks particularly pretty, but the following code should illustrate
what I have in mind. It basically substitutes the
system specific ScrollBars with the metal ones.
import javax.swing.*;
import javax.swing.plaf.metal.MetalScrollBarUI;
//import javax.swing.plaf.metal.MetalScrollPaneUI;
import java.awt.*;
public class ScrollBarUIDemo extends JFrame {
public ScrollBarUIDemo() throws HeadlessException {
getContentPane().setLayout(new BorderLayout());
getContentPane().add(new JScrollPane(new JTable(),
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS),
BorderLayout.CENTER);
getContentPane().add(new JScrollBar(JScrollBar.HORIZONTAL), BorderLayout.SOUTH);
setBounds(100, 100, 200, 200);
setVisible(true);
}
public static void main(String[] args) throws IllegalAccessException, UnsupportedLookAndFeelException,
InstantiationException, ClassNotFoundException {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.put("ScrollBarUI", MetalScrollBarUI.class.getName());
//UIManager.put("ScrollPaneUI", MetalScrollPaneUI.class.getName());
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new ScrollBarUIDemo();
}
});
}
}
Original comment by hendrik....@gmail.com
on 31 Dec 2008 at 9:44
OK...I got it!
I will pull out the iApp ScrollBarUIs out into there own delegates. This will
actually be more in line with the new
HUD UI delegates coming in 0.9.4.
Original comment by kenneth....@gmail.com
on 31 Dec 2008 at 12:18
Great! Thanks.
Original comment by hendrik....@gmail.com
on 31 Dec 2008 at 12:21
I've added the following new classes:
com.explodingpixels.macwidgets.plaf.IAppHorizontalScrollBarUI
com.explodingpixels.macwidgets.plaf.IAppVerticalScrollBarUI
Hendrik,
Do you have access to the Subversion repository? If so, update the project and
give the UI delegates a try.
Otherwise, I can email you a jar file.
I'll leave this issue open until you confirm that the changes do in fact meet
your needs.
-Ken
Original comment by kenneth....@gmail.com
on 2 Jan 2009 at 5:19
Thanks, Ken, for working on this.
Why two classes? Why not use something like in
BasicScrollBarUI.installComponents(), where you simply ask the
JScrollBar, which orientation it has?
Original comment by supp...@beatunes.com
on 2 Jan 2009 at 7:40
I loathe the switching BasicScrollBarUI does based on the orientation, but to
fully meet your needs, I guess I'll
have to collapse this down to one class.
I'll do that and have you give it a try.
Original comment by kenneth....@gmail.com
on 2 Jan 2009 at 7:48
I've combined
com.explodingpixels.macwidgets.plaf.IAppHorizontalScrollBarUI
com.explodingpixels.macwidgets.plaf.IAppVerticalScrollBarUI
into
com.explodingpixels.macwidgets.plaf.IAppScrollBarUI
which required some refactoring to the SkinnableScrollBarUI class.
Hendrik,
Can you try this out and let me know if it works as desired?
Thanks,
-Ken
Original comment by kenneth....@gmail.com
on 2 Jan 2009 at 9:25
I'll try this tomorrow. Thanks.
Original comment by supp...@beatunes.com
on 5 Jan 2009 at 9:09
Hm - doesn't seem to work quite right.
Did this work with the code I posted above on your machine?
Original comment by supp...@beatunes.com
on 7 Jan 2009 at 10:20
Attachments:
Hi Hendrick,
I didn't try the code you supplied, rather I verified I could install the UI
delegate as a typical Swing scroll bar UI
delegate (no supplied information at construction time).
Does your supplied code work with other ScrollBarUI delegates?
-Ken
Original comment by kenneth....@gmail.com
on 7 Jan 2009 at 12:41
Ken,
did some digging. Just add:
public static ComponentUI createUI(JComponent c) {
return new IAppScrollBarUI();
}
to IAppScrollBarUI and it looks great.
Thanks for adding this. Makes it much easier to use the lib!
-hendrik
Original comment by supp...@beatunes.com
on 7 Jan 2009 at 6:44
Thanks for digging that up Hendrik. I've added the createUI method, so it
should be all set now! Give me the
thumbs up when you update and verify the fix and I'll close this issue.
Feel free to let me know about other API usability issues.
Thanks for helping out with this one.
-Ken
Original comment by kenneth....@gmail.com
on 7 Jan 2009 at 6:51
Works. Close it.
Thanks, Ken.
Original comment by supp...@beatunes.com
on 7 Jan 2009 at 7:00
Great...thanks.
Original comment by kenneth....@gmail.com
on 7 Jan 2009 at 7:31
Original issue reported on code.google.com by
supp...@beatunes.com
on 15 Dec 2008 at 12:29