Wim.Zhai
5 years ago
5 changed files with 159 additions and 3 deletions
@ -0,0 +1,23 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.common.annotations.Open; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@Open |
||||
public interface MultiStyleUIConfigProvider extends Mutable { |
||||
String XML_TAG = "MultiStyleUIConfigProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 获取配置项list |
||||
* |
||||
* @return 配置项list |
||||
*/ |
||||
List<StyleUIConfigProvider> getConfigList(); |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.common.annotations.Open; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@Open |
||||
public interface StyleUIConfigProvider extends Mutable { |
||||
String XML_TAG = "CustomStyleUIConfigProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* @return 配置名 |
||||
*/ |
||||
String configName(); |
||||
|
||||
/** |
||||
* @param changeListener 需要添加的listener |
||||
* @return 对应的component |
||||
*/ |
||||
JComponent uiComponent(ChangeListener changeListener); |
||||
|
||||
/** |
||||
* @return 更新后的样式 |
||||
*/ |
||||
Style updateConfig(); |
||||
|
||||
/** |
||||
* @param style 待渲染的样式 |
||||
*/ |
||||
void populateConfig(Style style); |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.StyleUIConfigProvider; |
||||
import com.fr.design.fun.MultiStyleUIConfigProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@API(level = MultiStyleUIConfigProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractMultiStyleUIConfigProvider extends AbstractProvider implements MultiStyleUIConfigProvider { |
||||
@Override |
||||
public List<StyleUIConfigProvider> getConfigList() { |
||||
return new ArrayList<StyleUIConfigProvider>(); |
||||
} |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.design.fun.StyleUIConfigProvider; |
||||
import com.fr.stable.StringUtils; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@API(level = StyleUIConfigProvider.CURRENT_LEVEL) |
||||
public class AbstractStyleUIConfigProvider extends AbstractProvider implements StyleUIConfigProvider { |
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String configName() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
@Override |
||||
public JComponent uiComponent(ChangeListener changeListener) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public Style updateConfig() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void populateConfig(Style style) { |
||||
|
||||
} |
||||
} |
Loading…
Reference in new issue