-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AbstractLayoutManager.java class added to simplify layout coding All custom layout managers refactored and now built upon AbstractLayoutManager.java (which implements Swing LayoutManager2) MultiLayout.java added which can provide multiply layouts support to any container, its still up to you which layout wil handle each type of components MultiLayout.java is set into each WebGlassPane.java at creation and glass pane supports multiply layouts at the same time now Optimizations made to default listeners list sizes in all WebLaF components
- Loading branch information
Showing
122 changed files
with
4,353 additions
and
1,090 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
src/com/alee/examples/groups/notification/CustomNotificationsExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* | ||
* This file is part of WebLookAndFeel library. | ||
* | ||
* WebLookAndFeel library is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* WebLookAndFeel library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with WebLookAndFeel library. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.alee.examples.groups.notification; | ||
|
||
import com.alee.examples.WebLookAndFeelDemo; | ||
import com.alee.examples.content.DefaultExample; | ||
import com.alee.extended.panel.CenterPanel; | ||
import com.alee.extended.panel.GroupPanel; | ||
import com.alee.extended.time.ClockType; | ||
import com.alee.extended.time.WebClock; | ||
import com.alee.laf.button.WebButton; | ||
import com.alee.managers.notification.NotificationIcon; | ||
import com.alee.managers.notification.NotificationManager; | ||
import com.alee.managers.notification.WebNotificationPopup; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
|
||
/** | ||
* Custom notifications example. | ||
* | ||
* @author Mikle Garin | ||
*/ | ||
|
||
public class CustomNotificationsExample extends DefaultExample | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String getTitle () | ||
{ | ||
return "Custom notifications"; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String getDescription () | ||
{ | ||
return "Web-styled custom notifications"; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public Component getPreview ( WebLookAndFeelDemo owner ) | ||
{ | ||
WebButton notification1 = new WebButton ( "Simple custom content" ); | ||
notification1.addActionListener ( new ActionListener () | ||
{ | ||
@Override | ||
public void actionPerformed ( ActionEvent e ) | ||
{ | ||
final WebNotificationPopup notificationPopup = new WebNotificationPopup (); | ||
notificationPopup.setIcon ( NotificationIcon.question ); | ||
|
||
final JLabel label = new JLabel ( "Are you sure you want to" ); | ||
final WebButton button = new WebButton ( "discard changes?" ); | ||
button.setRolloverDecoratedOnly ( true ); | ||
button.setDrawFocus ( false ); | ||
button.setLeftRightSpacing ( 0 ); | ||
button.setBoldFont (); | ||
button.addActionListener ( new ActionListener () | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void actionPerformed ( ActionEvent e ) | ||
{ | ||
notificationPopup.hidePopup (); | ||
} | ||
} ); | ||
final CenterPanel centerPanel = new CenterPanel ( button, false, true ); | ||
notificationPopup.setContent ( new GroupPanel ( 2, label, centerPanel ) ); | ||
|
||
NotificationManager.showNotification ( notificationPopup ); | ||
} | ||
} ); | ||
|
||
WebButton notification2 = new WebButton ( "Limited duration notification" ); | ||
notification2.addActionListener ( new ActionListener () | ||
{ | ||
@Override | ||
public void actionPerformed ( ActionEvent e ) | ||
{ | ||
final WebNotificationPopup notificationPopup = new WebNotificationPopup (); | ||
notificationPopup.setIcon ( NotificationIcon.clock ); | ||
notificationPopup.setDisplayTime ( 5000 ); | ||
|
||
final WebClock clock = new WebClock (); | ||
clock.setClockType ( ClockType.timer ); | ||
clock.setTimeLeft ( 6000 ); | ||
clock.setTimePattern ( "'This notification will close in' ss 'seconds'" ); | ||
notificationPopup.setContent ( new GroupPanel ( clock ) ); | ||
|
||
NotificationManager.showNotification ( notificationPopup ); | ||
clock.start (); | ||
} | ||
} ); | ||
|
||
return new GroupPanel ( 4, false, notification1, notification2 ); | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
src/com/alee/examples/groups/notification/NotificationsGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* This file is part of WebLookAndFeel library. | ||
* | ||
* WebLookAndFeel library is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* WebLookAndFeel library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with WebLookAndFeel library. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.alee.examples.groups.notification; | ||
|
||
import com.alee.examples.content.DefaultExampleGroup; | ||
import com.alee.examples.content.Example; | ||
|
||
import javax.swing.*; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Notifications usage examples group. | ||
* | ||
* @author Mikle Garin | ||
*/ | ||
|
||
public class NotificationsGroup extends DefaultExampleGroup | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public Icon getGroupIcon () | ||
{ | ||
return loadGroupIcon ( "notification.png" ); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String getGroupName () | ||
{ | ||
return "Notifications"; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String getGroupDescription () | ||
{ | ||
return "Various examples of notifications usage"; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public List<Example> getGroupExamples () | ||
{ | ||
List<Example> examples = new ArrayList<Example> (); | ||
examples.add ( new TextNotificationsExample () ); | ||
examples.add ( new CustomNotificationsExample () ); | ||
return examples; | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
src/com/alee/examples/groups/notification/TextNotificationsExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* This file is part of WebLookAndFeel library. | ||
* | ||
* WebLookAndFeel library is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* WebLookAndFeel library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with WebLookAndFeel library. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.alee.examples.groups.notification; | ||
|
||
import com.alee.examples.WebLookAndFeelDemo; | ||
import com.alee.examples.content.DefaultExample; | ||
import com.alee.extended.panel.GroupPanel; | ||
import com.alee.laf.button.WebButton; | ||
import com.alee.managers.notification.NotificationIcon; | ||
import com.alee.managers.notification.NotificationManager; | ||
import com.alee.managers.notification.NotificationOption; | ||
|
||
import java.awt.*; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
|
||
/** | ||
* Text notifications example. | ||
* | ||
* @author Mikle Garin | ||
*/ | ||
|
||
public class TextNotificationsExample extends DefaultExample | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String getTitle () | ||
{ | ||
return "Text notifications"; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String getDescription () | ||
{ | ||
return "Web-styled text notifications"; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public Component getPreview ( WebLookAndFeelDemo owner ) | ||
{ | ||
WebButton notification1 = new WebButton ( "Simple text notification" ); | ||
notification1.addActionListener ( new ActionListener () | ||
{ | ||
@Override | ||
public void actionPerformed ( ActionEvent e ) | ||
{ | ||
NotificationManager.showNotification ( "Simple notification" ); | ||
} | ||
} ); | ||
|
||
WebButton notification2 = new WebButton ( "Notification with custom icon" ); | ||
notification2.addActionListener ( new ActionListener () | ||
{ | ||
@Override | ||
public void actionPerformed ( ActionEvent e ) | ||
{ | ||
NotificationManager.showNotification ( "Custom notification icon", NotificationIcon.tip.getIcon () ); | ||
} | ||
} ); | ||
|
||
WebButton notification3 = new WebButton ( "Notification with options" ); | ||
notification3.addActionListener ( new ActionListener () | ||
{ | ||
@Override | ||
public void actionPerformed ( ActionEvent e ) | ||
{ | ||
NotificationManager.showNotification ( "Choose one of available options...", NotificationIcon.database.getIcon (), | ||
NotificationOption.apply, NotificationOption.discard ); | ||
} | ||
} ); | ||
|
||
return new GroupPanel ( 4, false, notification1, notification2, notification3 ); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.