-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUpdateFontSizeOperation.java
More file actions
47 lines (34 loc) · 1017 Bytes
/
UpdateFontSizeOperation.java
File metadata and controls
47 lines (34 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package actions.singleinstanceoperations;
import actions.menu.ActionsMenuBarTitles;
import paintcomponents.TextPaintComponent;
import ui.PaintPanel;
import ui.general.InputManager;
import ui.general.InputManagerDelegate;
/**
* Single instance operaiton responsible for updating the font size
* @author chenzb
*
*/
public class UpdateFontSizeOperation extends SingleInstanceOperation<TextPaintComponent>{
public UpdateFontSizeOperation(PaintPanel panel) {
super(panel);
}
@Override
protected void performActionOnInstance(TextPaintComponent instance) {
InputManager.sharedInstance().askForFloat(panel, new InputManagerDelegate<Float>() {
@Override
public void didFinishInput(Float input) {
instance.setFontSize(input);
panel.repaint();
}
});
}
@Override
public String locationString() {
return ActionsMenuBarTitles.Edit().Font_Size().toString();
}
@Override
protected Class<TextPaintComponent> getGenericClassType() {
return TextPaintComponent.class;
}
}