Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ProjectUtilities
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Libraries
java
ProjectUtilities
Commits
8794e1b9
Commit
8794e1b9
authored
5 months ago
by
Raphael GIRARDOT
Browse files
Options
Downloads
Patches
Plain Diff
DEFAULT_BACKGROUND is now public + minor corrections
parent
cce12d72
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SwingUtilities/src/main/java/fr/soleil/lib/project/swing/ArrowButton.java
+9
-7
9 additions, 7 deletions
...rc/main/java/fr/soleil/lib/project/swing/ArrowButton.java
with
9 additions
and
7 deletions
SwingUtilities/src/main/java/fr/soleil/lib/project/swing/ArrowButton.java
+
9
−
7
View file @
8794e1b9
...
...
@@ -35,9 +35,9 @@ import fr.soleil.lib.project.awt.ColorUtils;
*/
public
class
ArrowButton
extends
JButton
implements
MouseListener
{
private
static
final
long
serialVersionUID
=
5437073960702647214
L
;
private
static
final
long
serialVersionUID
=
-
1363309152147062372
L
;
p
rotected
static
final
Color
DEFAULT_BACKGROUND
=
new
Color
(
102
,
102
,
153
);
p
ublic
static
final
Color
DEFAULT_BACKGROUND
=
new
Color
(
102
,
102
,
153
);
public
static
final
int
DEFAULT_SIZE
=
5
;
protected
static
final
double
BRIGHTNESS_FACTOR
=
0.3
;
protected
static
final
double
STATE_FACTOR
=
0.2
;
...
...
@@ -54,7 +54,6 @@ public class ArrowButton extends JButton implements MouseListener {
private
int
orientation
;
private
Color
lightColor
;
private
Color
darkColor
;
private
volatile
boolean
mouseOver
;
public
ArrowButton
()
{
this
(
UP
);
...
...
@@ -116,15 +115,17 @@ public class ArrowButton extends JButton implements MouseListener {
@Override
public
void
mouseEntered
(
MouseEvent
e
)
{
mouseOver
=
true
;
if
(
isEnabled
())
{
getModel
().
setRollover
(
true
);
repaint
();
}
}
@Override
public
void
mouseExited
(
MouseEvent
e
)
{
mouseOver
=
false
;
if
(
getModel
().
isRollover
())
{
getModel
().
setRollover
(
false
);
}
if
(
isEnabled
())
{
repaint
();
}
...
...
@@ -208,7 +209,7 @@ public class ArrowButton extends JButton implements MouseListener {
* @return Whether mouse is over this {@link ArrowButton}
*/
protected
boolean
isMouseOver
()
{
return
mouseO
ver
;
return
getModel
().
isRollo
ver
()
;
}
@Override
...
...
@@ -389,7 +390,8 @@ public class ArrowButton extends JButton implements MouseListener {
JFrame
testFrame
=
new
JFrame
(
ArrowButton
.
class
.
getSimpleName
()
+
" test"
);
testFrame
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
testFrame
.
setContentPane
(
panel
);
testFrame
.
setSize
(
300
,
80
);
testFrame
.
pack
();
testFrame
.
setSize
(
300
,
testFrame
.
getHeight
());
testFrame
.
setVisible
(
true
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment