Jide tabbed pane close icon Highlight

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Jide tabbed pane close icon Highlight

Postby rathinamsm » Thu Feb 16, 2012 11:24 pm

Hi Team,

I have an query, In Jide Tabbed Pane, I sets the color using setBackgroundAt( .. "Grey / Light Grey "color for Selected / Unselected tab.
After applying the color. the Close Icon is not visible clearly.

1. How to Highlight the Close Icon / or is there any way to set the customize close icon for the Close Button.
2. The Tab Header border color is not visible in the Grey background color. How to make bold for the tab header border color.

Let me know please
Attachments
JideTabColor.PNG
Please check the close icon and tab header border color.
JideTabColor.PNG (2.5 KiB) Viewed 55556 times
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am

Re: Jide tabbed pane close icon Highlight

Postby JIDE Support » Fri Feb 17, 2012 2:11 pm

Please try to override JideTabbedPane#createNoFocusButton() then override NoFocusButton#getShadowColor()/getPressedShadowColor()/getForegroundColor()/etc. to customize the color setting of the button.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Jide tabbed pane close icon Highlight

Postby rathinamsm » Mon Feb 20, 2012 3:39 am

Hi Team

1. I implemented the above methods by extending JideTabbedPane and implemented TabbedPane customizer and add it to the Jframe. The tab header close buttons fore color, shadow gets affected and working correctly.

public class JideTabbedPaneTest extends JideTabbedPane implements
TabbedPaneCustomizer {

@Override
public NoFocusButton createNoFocusButton(int arg0) {
return new ExtendedNoFocusButton();
}

class ExtendedNoFocusButton extends NoFocusButton {

@Override
public void setOpaque(boolean isOpaque) {

super.setOpaque(true);
}


@Override
public void setBorder(Border border) {

super.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 2));
}

@Override
protected Color getForegroundColor() {
return Color.GREEN;
}

@Override
protected Color getShadowColor() {

return Color.BLACK;
}

@Override
protected Color getPressedShadowColor() {

return Color.BLACK;

}

}

2. But the same is not reflecting in the docking manager.


DefaultDockingManager dockingManager = (DefaultDockingManager) holderPanel.getDockingManager();

dockingManager.setTabbedPaneCustomizer(tabbedPaneCust);


May i please know to resolve it and where is the problem.
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am

Re: Jide tabbed pane close icon Highlight

Postby JIDE Support » Mon Feb 20, 2012 9:09 am

JIDE Docking Framework creates its own JideTabbedPane subclass and use it. If you subclass class JideTabbedPane, there is no way for you to use it in JIDE Docking Framework. We will take a look and see if we can provide a solution or workaround in the next release.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Jide tabbed pane close icon Highlight

Postby rathinamsm » Wed Mar 14, 2012 9:38 pm

Hi Team, Is any update regarding the border color and shadow color to set.
Let me know if there is any update.

Thanks.
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am

Re: Jide tabbed pane close icon Highlight

Postby JIDE Support » Thu Mar 15, 2012 10:55 am

After a second thought, I believe you could achieve your goal with the following code. Please give it a try and let us know if it works.
Code: Select all
    @Override
    protected DockingManager createDockingManager(Container contentContainer) {
        return new DefaultDockingManager(this, contentContainer) {
            @Override
            public FrameContainer createFrameContainer() {
                FrameContainer frameContainer = new FrameContainer(this) {
                    @Override
                    public NoFocusButton createNoFocusButton(int arg0) {
                        return new ExtendedNoFocusButton();
                    }
                };
                customizeFrameContainer(frameContainer);
                return frameContainer;
            }
        };
    }

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Jide tabbed pane close icon Highlight

Postby rathinamsm » Mon Mar 19, 2012 4:24 am

Hi team,

I worked on the idea of highlight the close button,

1. I Created The Class of test_holderpanel extends DockableHolderPanel() implements RootPaneContainer.

2. I created another class which is of JideTabbedPaneTest extends JideTabbedPane(), which has a inner class ExtendedNoFocusButton.

3. I created third class which is dockingManager_test which extends DefaultDockingManger() as you specified in the early post.

4. Last I created TabbedPane_Cust which implements TabbedPaneCustomizer().


In the test_holderpanel I override the method of createDockingManger() of return new DockingManger_Test{), and have the return Button of ExtendedNoFocusButton of jidetabbedpanetest's innerclass(ExtendedNoFocusButton) for the createNoFocusButton of FrameContainer.

To create DockingManger I explicitly call the method createDockingManger in test_holderpanel.

When adding the dockable frames in the dockingManger. No frames are visible.

I have attached the Classes which I used to highlight the Tab “Close Button”.

Could you help what is the mistake in this and to fix the “Tab Color” Issue?
Attachments
DockingManager_Test.java
Hi 2 More class is included.. Please create it has 2 separate class.
(3.54 KiB) Downloaded 2048 times
JideTabbedPaneTest.java
(1.23 KiB) Downloaded 2088 times
InitialLayoutDockDemo.java
(5.78 KiB) Downloaded 2063 times
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am

Re: Jide tabbed pane close icon Highlight

Postby JIDE Support » Mon Mar 19, 2012 9:55 am

The problem lies on how you override the classes. Please give the modified classes a look FYI.

Thanks,
Attachments
FrameContainerTest.java
(1.76 KiB) Downloaded 2051 times
InitialLayoutDockDemo.java
(5.97 KiB) Downloaded 2080 times
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Jide tabbed pane close icon Highlight

Postby rathinamsm » Tue Mar 20, 2012 5:09 am

Hi Team.

Thanks for the Reply.
1. But the setTabResizeMode - None and Fixed is affected when i apply the changes. Please confirm.?

2. Unable to modify the "Tab header border" color. Could You please help me to set the border color of "Tab 2" in screen shot ( my first screen shot in the post). Since the tab color and background color or same. It was hard to identify..
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am

Re: Jide tabbed pane close icon Highlight

Postby JIDE Support » Tue Mar 20, 2012 7:48 pm

1, I don't think it impacts the tab resize mode. Please let us know why you think it's impacted.
2, Can you please post an image of the test case and let me know which part you want to customize? I can't get a clue from the picture in your first post.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Jide Tabbed Pane "Tab Header Color"

Postby rathinamsm » Tue Mar 20, 2012 9:29 pm

Hi team,

1. As I mentioned in the First Post, if I set The TabbedPane setBackgroundColorAt(); and Application Backgroud as Same, The tab header border is hard to visible.
Please help to achive this tab header border. (Please Refer Picture Jide Post_1.PNG, Jide Post_2.PNG).

2. The Third Jide_post_3 picture shows, that the Yellow Colored box, (setTabResizeMode() - NONE/FIX).in TabbedPane. Is Not Displayed. If we Extended the Dockingmanager and FrameContainer as you suggested.

We applied the setTabResizeMode in TabbedPaneCustomizer().

_panel.getDockingManager().setTabbedPaneCustomizer(new DockingManager.TabbedPaneCustomizer() {
public void customize(JideTabbedPane arg0) {

arg0.setTabPlacement(SwingConstants.TOP);
arg0.setUseDefaultShowCloseButtonOnTab(true);
arg0.setShowCloseButtonOnTab(true);
arg0.setTabResizeMode(JideTabbedPane.RESIZE_MODE_NONE);

help me to show setTab ResizeMode ? and Tab Header Border??..
Attachments
Jide Post_3.PNG
Jide Post_3.PNG (2.68 KiB) Viewed 55479 times
Jide Post_2.PNG
Jide Post_2.PNG (1.04 KiB) Viewed 55479 times
Jide Post_1.PNG
Jide Post_1.PNG (807 Bytes) Viewed 55479 times
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am

Re: Jide tabbed pane close icon Highlight

Postby JIDE Support » Wed Mar 21, 2012 10:10 am

1, to change the color of the border, please try to manage the color theme in the UI class. The sample code is included in the attached class FrameContainerTest.
2, the resize mode does not have any problem itself. The issue resides on how we override FrameContainerTest#createNoFocusButton(). It's also modified in the attached class FYI.

Thanks,
Attachments
FrameContainerTest.java
(2.51 KiB) Downloaded 2008 times
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Jide tabbed pane close icon Highlight

Postby rathinamsm » Thu Mar 22, 2012 6:39 am

Thanks Jide Team.
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am

Re: Jide tabbed pane close icon Highlight

Postby rathinamsm » Tue Mar 27, 2012 5:04 am

Hi Team,

I worked based on your idea for highlighting the selected and unselected tab with border.

We successfully set the Selected and Unselected border color, tab Foreground color also sets successfully. But we Unable to set the "tab header Background Color".

Please check the overridden method. Is the approach is correct in paintBackground() for setting the foreground and background color.


Please see the attached Screen Shot_1,

public void paintBackground(Graphics arg0, Component arg1) {

JideTabbedPane jideTabbedPane = (JideTabbedPane)arg1;
jideTabbedPane.setOpaque(false);

try {
int index = jideTabbedPane.getSelectedIndex();
for (int i = 0; i < jideTabbedPane.getTabCount(); i++) {
if (i == index) {
jideTabbedPane.setForegroundAt(i, Color.BLACK);//---Displaying - refer screen shot
jideTabbedPane.setBackgroundAt(i, Color.WHITE);//---Not Displaying - refer screen shot
} else {
jideTabbedPane.setForegroundAt(i, Color.BLUE); //---Displaying - refer screen shot
jideTabbedPane.setBackgroundAt(i, Color.YELLOW); //---Not Displaying - refer screen shot
}
}
} catch (Exception e2) {
e2.printStackTrace();
}
super.paintBackground(arg0, arg1);
}
Attachments
FrameContainerTest.java
(1.83 KiB) Downloaded 2053 times
Extended_TabbedpaneUI.java
(1.34 KiB) Downloaded 2047 times
Screen_Shot_01.PNG
Screen_Shot_01.PNG (3.12 KiB) Viewed 55426 times
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am

Re: Jide tabbed pane close icon Highlight

Postby JIDE Support » Tue Mar 27, 2012 10:31 am

Please invoke JideTabbedPane#setBackgroundAt()/setForegroundAt() to change the background/foreground for a specific tab.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Jide tabbed pane close icon Highlight

Postby rathinamsm » Mon Apr 02, 2012 12:51 am

Hi Team,
I tried to set the background and foreground to jidetabbedpane as you specified by the setForegroundat(), and setBackgroundat(). in the following ways.

1.Setting the TabbedPane Customizer addChangeListener();

arg0.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent changeEvent) {
int index = arg0.getSelectedIndex();
int tabCount = arg0.getTabCount();
try {
for (int i = 0; i < tabCount; i++) {
if (i == index) {
arg0.setForegroundAt(i,Color.BLUE);
arg0.setBackgroundAt(i,Color.GREEN);
} else {
arg0.setForegroundAt(i,Color.BLUE);
arg0.setBackgroundAt(i,Color.RED);
}
}
} catch (Exception e2) {
}
}
});
2. Defining Color at Override paintBackground() Method in BasicJidetabbedpane(); which SetUi to Frame Container. as like follows.

@Override
public void paintBackground(Graphics arg0, Component arg1) {

JideTabbedPane jideTabbedPane = (JideTabbedPane)arg1;
jideTabbedPane.setOpaque(false);

try {
int index = jideTabbedPane.getSelectedIndex();
for (int i = 0; i < jideTabbedPane.getTabCount(); i++) {
if (i == index) {
jideTabbedPane.setForegroundAt(i,Color.WHITE);
jideTabbedPane.setBackgroundAt(i,Color.GREEN);
} else {
jideTabbedPane.setForegroundAt(i,Color.WHITE);
jideTabbedPane.setBackgroundAt(i,Color.RED);
}
}
} catch (Exception e2) {
e2.printStackTrace();
}
super.paintBackground(arg0, arg1);
}


3. Making the ChangeSkin Method, as Like Follows,

protected void changeSkin() {
resetSkin();
jideTabbedPane.revalidate();
jideTabbedPane.repaint();
validate();
repaint();
}

private void resetSkin() {
int index = jideTabbedPane.getSelectedIndex();
int tabCount = jideTabbedPane.getTabCount();
try {
for (int i = 0; i < tabCount; i++) {
if (i == index) {
jideTabbedPane.setForegroundAt(i,Color.ORANGE);
jideTabbedPane.setBackgroundAt(i,Color.GREEN);
} else {
jideTabbedPane.setForegroundAt(i,Color.ORANGE);
jideTabbedPane.setBackgroundAt(i,Color.RED);
}
jideTabbedPane.revalidate();
jideTabbedPane.repaint();
}
} catch (Exception e2) {
}

}
Please see the Screen Shot_01, in that the setBackgroundAt(), color is not repainted.
Only the foreground is repainting in resetskin().
How can i able to resolve this problem?
Is Any way to set Background for tab?
Attachments
FrameContainer_test.java
Contains Two Class please separate these as two class.
(3.44 KiB) Downloaded 2010 times
InitialLayoutDockDemo.java
(7.92 KiB) Downloaded 2001 times
Screen Shot_01.PNG
Screen Shot_01.PNG (9.23 KiB) Viewed 55410 times
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am

Re: Jide tabbed pane close icon Highlight

Postby JIDE Support » Mon Apr 02, 2012 10:41 am

Please let your ExtendedJideTabbedPaneUI extends VsnetJideTabbedPaneUI.

Thanks,
Attachments
FrameContainer_test.java
(1.83 KiB) Downloaded 2099 times
Extended_TabbedpaneUI.java
(1.13 KiB) Downloaded 2032 times
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Jide tabbed pane close icon Highlight

Postby rathinamsm » Tue Apr 03, 2012 3:55 am

Thanks for the reply. :)
rathinamsm
 
Posts: 40
Joined: Wed Nov 02, 2011 5:36 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 7 guests