kerry
2 years ago
13 changed files with 244 additions and 60 deletions
@ -0,0 +1,56 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.base.chart.BaseChartCollection; |
||||
import com.fr.chartx.attr.ChartProvider; |
||||
import com.fr.general.FRFont; |
||||
import com.fr.report.cell.CellElement; |
||||
import com.fr.stable.fun.mark.Selectable; |
||||
|
||||
import java.awt.Font; |
||||
|
||||
/** |
||||
* 主要用于fvs报表块内元素默认值的调整,以达到所见所得效果,后续fvs内置后删除 |
||||
*/ |
||||
public interface DefaultValueAdjustProvider extends Selectable { |
||||
String MARK_STRING = "DefaultValueAdjustProvider"; |
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 调整单元格对象默认值 |
||||
* |
||||
* @param cellElement |
||||
*/ |
||||
void adjustCellElement(CellElement cellElement); |
||||
|
||||
/** |
||||
* 调整富文本默认值 |
||||
* |
||||
* @param fontSize |
||||
* @return |
||||
*/ |
||||
int adjustRichTextTransform(int fontSize, double transformedFontSize); |
||||
|
||||
/** |
||||
* 调整ChartCollection |
||||
* |
||||
* @param chartCollection |
||||
*/ |
||||
void adjustChartCollectionStyle(BaseChartCollection chartCollection); |
||||
|
||||
/** |
||||
* 调整图表 |
||||
* |
||||
* @param chartProvider |
||||
*/ |
||||
void adjustChart(ChartProvider chartProvider); |
||||
|
||||
|
||||
/** |
||||
* 转成当前分辨率下显示的font |
||||
* @param font |
||||
* @param resolution |
||||
* @return |
||||
*/ |
||||
Font transformFontByResolution(FRFont font, int resolution); |
||||
|
||||
} |
@ -0,0 +1,24 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
|
||||
import com.fr.design.fun.DefaultValueAdjustProvider; |
||||
import com.fr.stable.fun.assist.Selector; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
@API(level = DefaultValueAdjustProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractDefaultValueAdjustProvider extends AbstractProvider implements DefaultValueAdjustProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
public String mark4Provider() { |
||||
return this.getClass().getName(); |
||||
} |
||||
|
||||
public Selector selector() { |
||||
return Selector.ALWAYS; |
||||
} |
||||
} |
@ -0,0 +1,37 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.base.AutoChangeLineProvider; |
||||
import com.fr.base.DefaultAutoChangeLine; |
||||
import com.fr.base.ScreenResolution; |
||||
import com.fr.design.fun.ReportLengthUNITProvider; |
||||
import com.fr.design.unit.UnitConvertUtil; |
||||
|
||||
public class AbsoluteMeasureUIMode implements DesignerUIMode { |
||||
|
||||
private static class AbsoluteMeasureUIModeHolder { |
||||
private static final AbsoluteMeasureUIMode absoluteMeasureUIMode = new AbsoluteMeasureUIMode(); |
||||
} |
||||
|
||||
private AbsoluteMeasureUIMode() { |
||||
|
||||
} |
||||
|
||||
public static AbsoluteMeasureUIMode getInstance() { |
||||
return AbsoluteMeasureUIModeHolder.absoluteMeasureUIMode; |
||||
} |
||||
|
||||
@Override |
||||
public ReportLengthUNITProvider parseLengthUNIT(int unitType) { |
||||
return UnitConvertUtil.parseLengthUNIT(unitType); |
||||
} |
||||
|
||||
@Override |
||||
public AutoChangeLineProvider getAutoChangeLineStrategy() { |
||||
return new DefaultAutoChangeLine(); |
||||
} |
||||
|
||||
@Override |
||||
public int getScreenResolution() { |
||||
return ScreenResolution.getScreenResolution(); |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.base.AutoChangeLineProvider;; |
||||
import com.fr.design.fun.ReportLengthUNITProvider; |
||||
|
||||
/** |
||||
* 设计器上和展示相关配置 |
||||
*/ |
||||
public interface DesignerUIMode { |
||||
|
||||
ReportLengthUNITProvider parseLengthUNIT(int unitType); |
||||
|
||||
AutoChangeLineProvider getAutoChangeLineStrategy(); |
||||
|
||||
int getScreenResolution(); |
||||
|
||||
} |
@ -0,0 +1,38 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.base.AutoChangeLineProvider; |
||||
import com.fr.design.fun.ReportLengthUNITProvider; |
||||
import com.fr.form.fit.NewUIModeAutoChangeLine; |
||||
import com.fr.stable.Constants; |
||||
|
||||
public class SimulateWebUIMode implements DesignerUIMode { |
||||
|
||||
private static class SimulateWebUIModeHolder { |
||||
private static final SimulateWebUIMode simulateWebUIMode = new SimulateWebUIMode(); |
||||
} |
||||
|
||||
private SimulateWebUIMode() { |
||||
|
||||
} |
||||
|
||||
public static SimulateWebUIMode getInstance() { |
||||
return SimulateWebUIModeHolder.simulateWebUIMode; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public ReportLengthUNITProvider parseLengthUNIT(int unitType) { |
||||
return new PXReportLengthUNIT(); |
||||
} |
||||
|
||||
@Override |
||||
public AutoChangeLineProvider getAutoChangeLineStrategy() { |
||||
return new NewUIModeAutoChangeLine(); |
||||
} |
||||
|
||||
@Override |
||||
public int getScreenResolution() { |
||||
return Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue