Skip to content

Commit 36c6661

Browse files
committed
Merge remote-tracking branch 'upstream/main' into mod-changelog
2 parents 8fed3b7 + 78a78f4 commit 36c6661

File tree

23 files changed

+5479
-47
lines changed

23 files changed

+5479
-47
lines changed

HMCL/build.gradle.kts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,29 @@ tasks.checkstyleMain {
117117
exclude("**/org/jackhuang/hmcl/ui/image/apng/**")
118118
}
119119

120-
tasks.compileJava {
121-
options.compilerArgs.add("--add-exports=java.base/jdk.internal.loader=ALL-UNNAMED")
122-
}
123-
124120
val addOpens = listOf(
125121
"java.base/java.lang",
126122
"java.base/java.lang.reflect",
127123
"java.base/jdk.internal.loader",
128124
"javafx.base/com.sun.javafx.binding",
129125
"javafx.base/com.sun.javafx.event",
130126
"javafx.base/com.sun.javafx.runtime",
127+
"javafx.base/javafx.beans.property",
131128
"javafx.graphics/javafx.css",
129+
"javafx.graphics/javafx.stage",
132130
"javafx.graphics/com.sun.javafx.stage",
131+
"javafx.graphics/com.sun.javafx.util",
133132
"javafx.graphics/com.sun.prism",
134133
"javafx.controls/com.sun.javafx.scene.control",
135134
"javafx.controls/com.sun.javafx.scene.control.behavior",
136135
"javafx.controls/javafx.scene.control.skin",
137136
"jdk.attach/sun.tools.attach",
138137
)
139138

139+
tasks.compileJava {
140+
options.compilerArgs.addAll(addOpens.map { "--add-exports=$it=ALL-UNNAMED" })
141+
}
142+
140143
val hmclProperties = buildList {
141144
add("hmcl.version" to project.version.toString())
142145
add("hmcl.add-opens" to addOpens.joinToString(" "))
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package com.jfoenix.controls;
21+
22+
import com.jfoenix.utils.JFXNodeUtils;
23+
import javafx.geometry.Insets;
24+
import javafx.scene.Node;
25+
import javafx.scene.layout.*;
26+
import javafx.scene.paint.Color;
27+
28+
/**
29+
* JFXClippedPane is a StackPane that clips its content if exceeding the pane bounds.
30+
*
31+
* @author Shadi Shaheen
32+
* @version 1.0
33+
* @since 2018-06-02
34+
*/
35+
public class JFXClippedPane extends StackPane {
36+
37+
private final Region clip = new Region();
38+
39+
public JFXClippedPane() {
40+
super();
41+
init();
42+
}
43+
44+
public JFXClippedPane(Node... children) {
45+
super(children);
46+
init();
47+
}
48+
49+
private void init() {
50+
setClip(clip);
51+
clip.setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(2), Insets.EMPTY)));
52+
backgroundProperty().addListener(observable -> JFXNodeUtils.updateBackground(getBackground(), clip));
53+
}
54+
55+
@Override
56+
protected void layoutChildren() {
57+
super.layoutChildren();
58+
clip.resizeRelocate(0, 0, getWidth(), getHeight());
59+
}
60+
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package com.jfoenix.controls;
21+
22+
import com.jfoenix.skins.JFXColorPickerSkin;
23+
import javafx.css.CssMetaData;
24+
import javafx.css.SimpleStyleableBooleanProperty;
25+
import javafx.css.Styleable;
26+
import javafx.css.StyleableBooleanProperty;
27+
import javafx.css.converter.BooleanConverter;
28+
import javafx.scene.control.ColorPicker;
29+
import javafx.scene.control.Skin;
30+
import javafx.scene.paint.Color;
31+
32+
import java.util.ArrayList;
33+
import java.util.Collections;
34+
import java.util.List;
35+
36+
/**
37+
* JFXColorPicker is the metrial design implementation of color picker.
38+
*
39+
* @author Shadi Shaheen
40+
* @version 1.0
41+
* @since 2016-03-09
42+
*/
43+
public class JFXColorPicker extends ColorPicker {
44+
45+
/**
46+
* {@inheritDoc}
47+
*/
48+
public JFXColorPicker() {
49+
initialize();
50+
}
51+
52+
/**
53+
* {@inheritDoc}
54+
*/
55+
public JFXColorPicker(Color color) {
56+
super(color);
57+
initialize();
58+
}
59+
60+
/**
61+
* {@inheritDoc}
62+
*/
63+
@Override
64+
protected Skin<?> createDefaultSkin() {
65+
return new JFXColorPickerSkin(this);
66+
}
67+
68+
private void initialize() {
69+
this.getStyleClass().add(DEFAULT_STYLE_CLASS);
70+
}
71+
72+
/**
73+
* Initialize the style class to 'jfx-color-picker'.
74+
* <p>
75+
* This is the selector class from which CSS can be used to style
76+
* this control.
77+
*/
78+
private static final String DEFAULT_STYLE_CLASS = "jfx-color-picker";
79+
80+
private double[] preDefinedColors = null;
81+
82+
public double[] getPreDefinedColors() {
83+
return preDefinedColors;
84+
}
85+
86+
public void setPreDefinedColors(double[] preDefinedColors) {
87+
this.preDefinedColors = preDefinedColors;
88+
}
89+
90+
/**
91+
* disable animation on button action
92+
*/
93+
private final StyleableBooleanProperty disableAnimation = new SimpleStyleableBooleanProperty(StyleableProperties.DISABLE_ANIMATION,
94+
JFXColorPicker.this,
95+
"disableAnimation",
96+
false);
97+
98+
public final StyleableBooleanProperty disableAnimationProperty() {
99+
return this.disableAnimation;
100+
}
101+
102+
public final Boolean isDisableAnimation() {
103+
return disableAnimation != null && this.disableAnimationProperty().get();
104+
}
105+
106+
public final void setDisableAnimation(final Boolean disabled) {
107+
this.disableAnimationProperty().set(disabled);
108+
}
109+
110+
private static final class StyleableProperties {
111+
112+
private static final CssMetaData<JFXColorPicker, Boolean> DISABLE_ANIMATION =
113+
new CssMetaData<JFXColorPicker, Boolean>("-jfx-disable-animation",
114+
BooleanConverter.getInstance(), false) {
115+
@Override
116+
public boolean isSettable(JFXColorPicker control) {
117+
return control.disableAnimation == null || !control.disableAnimation.isBound();
118+
}
119+
120+
@Override
121+
public StyleableBooleanProperty getStyleableProperty(JFXColorPicker control) {
122+
return control.disableAnimationProperty();
123+
}
124+
};
125+
126+
127+
private static final List<CssMetaData<? extends Styleable, ?>> CHILD_STYLEABLES;
128+
129+
static {
130+
final List<CssMetaData<? extends Styleable, ?>> styleables =
131+
new ArrayList<>(ColorPicker.getClassCssMetaData());
132+
Collections.addAll(styleables, DISABLE_ANIMATION);
133+
CHILD_STYLEABLES = Collections.unmodifiableList(styleables);
134+
}
135+
}
136+
137+
@Override
138+
public List<CssMetaData<? extends Styleable, ?>> getControlCssMetaData() {
139+
return getClassCssMetaData();
140+
}
141+
142+
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData() {
143+
return StyleableProperties.CHILD_STYLEABLES;
144+
}
145+
}

0 commit comments

Comments
 (0)