Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in stable components... And few suggestions #124

Closed
sudhirdhumal289 opened this issue May 19, 2014 · 5 comments
Closed

Bugs in stable components... And few suggestions #124

sudhirdhumal289 opened this issue May 19, 2014 · 5 comments
Assignees

Comments

@sudhirdhumal289
Copy link

  1. I was trying to use symbolic font for button in button-popup, it shows what I want but when popup is show it shows a block instead of my desired symbol. (Note: I am using font from package, same font is installed on system also)

  2. I was testing modal popup in pop-over dialog and found minor bug. When dialog is showing on screen I minimized frame and dialog is just disappeared on opening frame. (Note: I have made dialog non-modal i.e. setModal(false); )

  3. I am not able to import components in window-builder. When i tried to do that it shows message that manifest file is not proper and shows all classes from show so I have to choose them manually.

  4. In web collapsible pane I have to press key for 2 / 3 times to transfer focus on next component, and also it shows me two different focused components one that I added in center and collapsible pane which looks so bad.

  5. there is no flexibility to set the color for mouse over for button. I used shine color but i want different upper and bottom colors.

Related forum topic:
http://weblookandfeel.com/forum/viewtopic.php?f=4&t=194

@mgarin mgarin added this to the Small issues milestone May 20, 2014
@mgarin mgarin self-assigned this May 20, 2014
mgarin added a commit that referenced this issue May 20, 2014
@mgarin
Copy link
Owner

mgarin commented May 20, 2014

1. I have committed a small fix for this issue, it should be fixed in next v1.28 update. You can build WebLaF from sources and check the fix now or I can provide you with distributive you need if you can't build it manually.

2. Could you provide a small code example that reproduces this issue?

3. Probably window-builder requires some manifest file with all visual components list or something like that - I don't know actually since I have never used it. If you can provide some resource or example of what exactly it requires - I might be able to add that for window-builder support (if it won't interfere with other features and stuff of course).

4. Let's use this code as a small example of the case:

public class PaneExample
{
    public static void main ( final String[] args )
    {
        WebLookAndFeel.install ();

        final WebTextField textField = new WebTextField ( "Sample focus", 20 );

        final WebTextArea textArea = new WebTextArea ( 4, 1 );
        final WebScrollPane scrollPane = new WebScrollPane ( textArea );
        final WebCollapsiblePane pane = new WebCollapsiblePane ( "Sample pane", scrollPane );

        TestFrame.show ( new GroupPanel ( 5, false, textField, pane ), 5 );
    }
}

First of all - you can always hide focus display on collapsible pane:

pane.setPaintFocus ( false );

Or on the other component:

scrollPane.setDrawFocus ( false )

Note: Methods might be called differently for some components, naming will be the same as soon as I add proper styling for those components.
In cases like this you can also hide unnecessary scroll borders:

final WebScrollPane scrollPane = new WebScrollPane ( textArea, false );

So finally you will get a pretty nice interface:

public class PaneExample
{
    public static void main ( final String[] args )
    {
        WebLookAndFeel.install ();

        final WebTextField textField = new WebTextField ( "Sample focus", 20 );

        final WebTextArea textArea = new WebTextArea ( 4, 1 );
        final WebScrollPane scrollPane = new WebScrollPane ( textArea, false );
        scrollPane.setDrawFocus ( false );
        scrollPane.setVerticalScrollBarPolicy ( ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS );
        final WebCollapsiblePane pane = new WebCollapsiblePane ( "Sample pane", scrollPane );

        TestFrame.show ( new GroupPanel ( 5, false, textField, pane ), 5 );
    }
}

Here is how it looks:
image
About the focus - yes, WebCollapsiblePane indeed has to be tabbed-through twice to get to the inner component due to the focusable button. I have also added a fix for this issue and it will be available in next v1.28 update.

5. There are actually tons of options in each component and I will make them all available for each specific when it is updated to a new styling scheme (like panel, label, scrollbar and popupmenu). So basically it is a matter of time when all those settings will become available. I will probably be releasing WebButton styling in next few updates.

@sudhirdhumal289
Copy link
Author

This code demonstrate the above mentioned bug (bug no. 2)

public class WebPopupTestFrame extends JFrame implements ActionListener {

    /**
     * Serial version ID
     */
    private static final long serialVersionUID = 1L;

    private WebToggleButton showTipsAndTrics;

    private WebPopOver tipsAndTricksPopup;

    public WebPopupTestFrame() {
        setSize(500, 300);
        setTitle("This is a test");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLocationRelativeTo(null);

        showTipsAndTrics = new WebToggleButton("Tips");
        showTipsAndTrics.setRolloverDecoratedOnly(true);
        showTipsAndTrics.setRound(0);
        showTipsAndTrics.setFocusable(false);
        showTipsAndTrics.setDrawFocus(false);
        showTipsAndTrics.setSelected(true);
        showTipsAndTrics.addActionListener(this);

        WebStatusBar panel = new WebStatusBar();
        panel.add(showTipsAndTrics, ToolbarLayout.END);

        getContentPane().add(panel, BorderLayout.SOUTH);

        JPanel panel_1 = new JPanel();
        getContentPane().add(panel_1, BorderLayout.CENTER);
    }

    @Override
    public void actionPerformed(ActionEvent ae) {
        if (showTipsAndTrics.isSelected()) {
            showTipsAndTrics();
        } else {
            hideTipsAndTricsPopup();
        }
    }

    public void showTipsAndTrics() {
        tipsAndTricksPopup = new WebPopOver(showTipsAndTrics);
        tipsAndTricksPopup.setModal(false);
        tipsAndTricksPopup.setMargin(10);
        tipsAndTricksPopup.setMovable(false);
        tipsAndTricksPopup.setLayout(new VerticalFlowLayout());

        final GroupPanel panel1 = new GroupPanel(4, new WebLabel(
                "1. Press anytime "), new WebHotkeyLabel("F1"), new WebLabel(
                " for descriptive help"));
        tipsAndTricksPopup.add(panel1);

        final GroupPanel panel3 = new GroupPanel(4, new WebLabel(
                "2. Press anytime "), new WebHotkeyLabel("Ctrl + S"),
                new WebLabel(" to save the details"));
        tipsAndTricksPopup.add(panel3);

        final GroupPanel panel4 = new GroupPanel(4, new WebLabel(
                "3. Press anytime "), new WebHotkeyLabel("Ctrl + P"),
                new WebLabel(" to print the details"));
        tipsAndTricksPopup.add(panel4);

        WebButton closeButton = new WebButton("Close", new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
                hideTipsAndTricsPopup();
            }
        });

        WebButton prevTip = new WebButton("Previous");
        WebButton nextTip = new WebButton("Next");
        WebButtonGroup navigationButtonGroup = new WebButtonGroup(true,
                prevTip, nextTip, closeButton);
        navigationButtonGroup.setButtonsDrawFocus(false);

        JPanel buttonsPanel = new JPanel();
        buttonsPanel.setOpaque(false);
        buttonsPanel.setBorder(null);
        FlowLayout buttonPanelLyt = new FlowLayout(FlowLayout.RIGHT);
        buttonPanelLyt.setHgap(0);
        buttonsPanel.setLayout(buttonPanelLyt);
        buttonsPanel.add(navigationButtonGroup);
        tipsAndTricksPopup.add(buttonsPanel);

        tipsAndTricksPopup.show(showTipsAndTrics);
    }

    public void hideTipsAndTricsPopup() {
        if (tipsAndTricksPopup != null) {
            tipsAndTricksPopup.dispose();
        }
        showTipsAndTrics.setSelected(false);
    }

    public static void main(String[] args) {
        WebPopupTestFrame frameObj = new WebPopupTestFrame();
        frameObj.setVisible(true);
        frameObj.showTipsAndTrics();
    }
}

@mgarin
Copy link
Owner

mgarin commented May 26, 2014

I was testing modal popup in pop-over dialog and found minor bug. 
When dialog is showing on screen I minimized frame and dialog is just disappeared 
on opening frame. (Note: I have made dialog non-modal i.e. setModal(false); )
This code demonstrate the above mentioned bug (bug no. 2)

I tried the example and didn't notice nor the bug you mentioned neither anything else.
I tried minimizing/restoring the frame - WebPopOver restores with it and doesn't close.

Probably there was something else that caused the issue.
For example, what might affect WebPopOver behavior slightly:

  • Your OS type/version
  • Your JDK version (6/7/8, - updates doesn't matter that much)
  • Whether you were working on primary screen or secondary screen
  • Some additional code affecting WebPopOver

I have published a temporary v1.28 build here:
http://weblookandfeel.com/downloads/gpl/weblaf-1.28.jar
Try running the example with it since it includes a lot of related fixes and might affect behavior as well. Note that this is not a release build and it still might contain some critical bugs in components and features I will be releasing in v1.28 final version.

P.S. And thanks for the full code example anyway :)

@mgarin mgarin added the fixed label Jun 26, 2014
@mgarin
Copy link
Owner

mgarin commented Jun 26, 2014

Some fixes and changes are now available in v1.28 update:
https://github.com/mgarin/weblaf/releases/tag/v1.28

@mgarin
Copy link
Owner

mgarin commented Jul 3, 2014

I guess the only issue left is the components import into window-builder.
I would move it into a separate issue if it is still a problem and will close this one.

@mgarin mgarin closed this as completed Jul 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants