forked from fanruan/design
kerry
5 years ago
9 changed files with 150 additions and 129 deletions
@ -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 CustomStyleUIConfigProvider 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,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<CustomStyleUIConfigProvider> getConfigList(); |
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.design.fun.CustomStyleUIConfigProvider; |
||||
import com.fr.stable.StringUtils; |
||||
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 = CustomStyleUIConfigProvider.CURRENT_LEVEL) |
||||
public class AbstractCustomStyleUIConfigProvider implements CustomStyleUIConfigProvider { |
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
@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) { |
||||
|
||||
} |
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.CustomStyleUIConfigProvider; |
||||
import com.fr.design.fun.MultiStyleUIConfigProvider; |
||||
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 implements MultiStyleUIConfigProvider { |
||||
@Override |
||||
public List<CustomStyleUIConfigProvider> getConfigList() { |
||||
return new ArrayList<CustomStyleUIConfigProvider>(); |
||||
} |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
} |
@ -1,22 +0,0 @@
|
||||
package com.fr.design.style.preference; |
||||
|
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-04 |
||||
*/ |
||||
public interface PreferenceConfigProvider extends Mutable { |
||||
|
||||
String XML_TAG = "PreferenceConfigProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 获取tab配置项 |
||||
* @return tab配置项 |
||||
*/ |
||||
List<PreferenceTabConfig> getConfigList(); |
||||
|
||||
} |
@ -1,32 +0,0 @@
|
||||
package com.fr.design.style.preference; |
||||
|
||||
import com.fr.base.Style; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-04 |
||||
*/ |
||||
public interface PreferenceTabConfig { |
||||
/** |
||||
* @return tab的标题 |
||||
*/ |
||||
String tabName(); |
||||
|
||||
/** |
||||
* @param changeListener 需要添加的listener |
||||
* @return tab对应的component |
||||
*/ |
||||
JComponent tabComponent(ChangeListener changeListener); |
||||
|
||||
/** |
||||
* @return 更新后的样式 |
||||
*/ |
||||
Style updateTabConfig(); |
||||
|
||||
/** |
||||
* @param style 待渲染的样式 |
||||
*/ |
||||
void populateTabConfig(Style style); |
||||
} |
@ -1,29 +0,0 @@
|
||||
package com.fr.design.style.preference.impl; |
||||
|
||||
import com.fr.design.style.preference.PreferenceConfigProvider; |
||||
import com.fr.design.style.preference.PreferenceTabConfig; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-04 |
||||
*/ |
||||
@API(level = PreferenceConfigProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractPreferenceConfigProvider implements PreferenceConfigProvider { |
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
@Override |
||||
public List<PreferenceTabConfig> getConfigList() { |
||||
return new ArrayList<PreferenceTabConfig>(); |
||||
} |
||||
} |
@ -1,33 +0,0 @@
|
||||
package com.fr.design.style.preference.impl; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.design.style.preference.PreferenceTabConfig; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-04 |
||||
*/ |
||||
public abstract class AbstractPreferenceTabConfig implements PreferenceTabConfig { |
||||
@Override |
||||
public String tabName() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
@Override |
||||
public JComponent tabComponent(ChangeListener changeListener) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public Style updateTabConfig() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void populateTabConfig(Style style) { |
||||
|
||||
} |
||||
} |
Loading…
Reference in new issue