-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from vincenzopalazzo/workingonversion1.0
Create version 1.0 BETA
- Loading branch information
Showing
21 changed files
with
928 additions
and
534 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,26 @@ | ||
/* | ||
* MIT License | ||
* | ||
* Copyright (c) 2019 Vincent Palazzo [email protected] | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package mdlaf.animation; | ||
|
||
import javax.swing.*; | ||
|
@@ -24,16 +47,11 @@ public MaterialUIStaticMovement(Color before, Color after, Color strongOnClick) | |
|
||
@Override | ||
public void mouseClicked(MouseEvent e) { | ||
/*For effect click, need create a timer ?*/ | ||
/* if(e == null){ | ||
throw new IllegalArgumentException("MouseEvent null"); | ||
} | ||
setColorComponent(e, after);*/ | ||
// do nothing | ||
} | ||
|
||
@Override | ||
public void mousePressed(MouseEvent e) { | ||
/*For effect click, need create a timer ?*/ | ||
if(e == null){ | ||
throw new IllegalArgumentException("MouseEvent null"); | ||
} | ||
|
@@ -42,7 +60,6 @@ public void mousePressed(MouseEvent e) { | |
|
||
@Override | ||
public void mouseReleased(MouseEvent e) { | ||
/*For effect click, need create a timer ?*/ | ||
if(e == null){ | ||
throw new IllegalArgumentException("MouseEvent null"); | ||
} | ||
|
@@ -65,7 +82,7 @@ public void mouseExited(MouseEvent e) { | |
setColorComponent(e, before); | ||
} | ||
|
||
/*** | ||
/** | ||
* This is service method for recicle code | ||
*/ | ||
private void setColorComponent(MouseEvent e, Color colorComponent){ | ||
|
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* MIT License | ||
* | ||
* Copyright (c) 2018 atharva washimkar, Vincent Palazzo | ||
* Copyright (c) 2018 atharva washimkar | ||
* Copyright (c) 2019 Vincent Palazzo [email protected] | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -27,7 +28,7 @@ | |
import java.awt.Color; | ||
import java.awt.event.*; | ||
|
||
public class MaterialUITimer implements MouseListener, ActionListener, MouseMotionListener { | ||
class MaterialUITimer implements MouseListener, ActionListener, MouseMotionListener { | ||
|
||
private Color from, to; | ||
private boolean forward; | ||
|
@@ -60,7 +61,6 @@ protected MaterialUITimer(JComponent component, Color to, int steps, int interva | |
this.steps = steps; | ||
|
||
this.component = component; | ||
this.component.addMouseListener(this); | ||
timer = new Timer(interval, this); | ||
component.setBackground(from); | ||
} | ||
|
@@ -90,6 +90,9 @@ public void mousePressed(MouseEvent me) { | |
} | ||
alpha = steps - 1; | ||
forward = false; | ||
if(timer.isRunning()){ | ||
timer.stop(); | ||
} | ||
timer.start(); | ||
|
||
alpha = 0; | ||
|
@@ -99,19 +102,22 @@ public void mousePressed(MouseEvent me) { | |
|
||
@Override | ||
public void mouseReleased(MouseEvent me) { | ||
|
||
//do nothing | ||
} | ||
|
||
@Override | ||
public void mouseClicked(MouseEvent me) { | ||
|
||
//do nothing | ||
} | ||
|
||
@Override | ||
public void mouseExited(MouseEvent me) { | ||
if (!me.getComponent().isEnabled()) { | ||
return; | ||
} | ||
if(timer.isRunning()){ | ||
timer.stop(); | ||
} | ||
alpha = steps - 1; | ||
forward = false; | ||
timer.start(); | ||
|
@@ -124,6 +130,9 @@ public void mouseEntered(MouseEvent me) { | |
} | ||
alpha = 0; | ||
forward = true; | ||
if(timer.isRunning()){ | ||
timer.stop(); | ||
} | ||
timer.start(); | ||
} | ||
|
||
|
@@ -138,7 +147,9 @@ public void actionPerformed(ActionEvent ae) { | |
} | ||
|
||
if (alpha == steps + 1 || alpha == -1) { | ||
timer.stop(); | ||
if(timer.isRunning()){ | ||
timer.stop(); | ||
} | ||
} | ||
} | ||
|
||
|
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
Oops, something went wrong.