// Path: src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/layout/XCalendarLayout.java
// public interface XCalendarLayout {
// 	
// 	/**
// 	 * 
// 	 */
// 	void layout(XCalendar calendar);
// 	
// 	void layout(XCalendar calendar, Composite parent, Rectangle bounds);
// }
// 
// Path: src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/layout/impl/XCalendarDefaultLayout.java
// public class XCalendarDefaultLayout implements XCalendarLayout {
// 	//
// 	private Composite prevParent;
// 	private Rectangle prevBounds;
// 	
// 	/**
// 	 * 
// 	 */
// 	@Override
// 	public void layout(XCalendar popup) {
// 		layout(popup, this.prevParent, this.prevBounds);
// 	}
// 	
// 	/**
// 	 * 
// 	 */
// 	@Override
// 	public void layout(XCalendar popup, Composite parent, Rectangle bounds) {
// 		//
// 		this.prevParent = parent;
// 		this.prevBounds = bounds;
// 		final XCalendarModel model = popup.getModel();
// 		final XCalendarTheme theme = model.getTheme();
// 		int x = theme.getMargin(), y = theme.getMargin();
// 		int m = theme.getMargin(), w = theme.getWidth() - 2 * m;
// 		
// 		//
// 		List<XCalendarWidget> widgets = popup.getWidgets();
// 		for(int i = 0; i < widgets.size(); i++) {
// 			final XCalendarWidget v = widgets.get(i);
// 			final Pair<Point> points = v.locate(x, y, w, m);
// 			v.setBounds(x, y, points.getV1().x, points.getV1().y);
// 			x = points.getV2().x; y = points.getV2().y;
// 		}
// 		
// 		//
// 		final Shell shell = popup.getShell();
// 		shell.setSize(new Point(theme.getWidth(), y + m)); setLocation(popup);
// 	}
// 
// 	/**
// 	 * 
// 	 */
// 	protected void setLocation(final XCalendar popup) {
// 		//
// 		final Shell shell = popup.getShell();
// 		final Display display = popup.getDisplay();
// 		final Rectangle r1 = display.map(prevParent, null, prevBounds);
// 		final Rectangle r2 = popup.getMonitor().getClientArea(); // Client area
// 		
// 		//
// 		final int margin = 2;
// 		final Point size = shell.getSize();
// 		int x = r1.x, y = r1.y + r1.height + margin;
// 		if(y + size.y > r2.y + r2.height) y = r1.y - size.y - margin;
// 		if(x < r2.x) x = r2.x; else if(x + size.x > r2.x + r2.width) x = r2.x + r2.width - size.x;
// 		shell.setLocation(x, y);
// 	}
// }
// 
// Path: src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/render/XCalendarRender.java
// public interface XCalendarRender {
// 	void render(XCalendar popup, GC gc);
// }
// 
// Path: src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/render/impl/XCalendarDefaultRender.java
// public class XCalendarDefaultRender implements XCalendarRender {
// 	
// 	public void render(XCalendar popup, GC gc) {
// 		final XCalendarModel model = popup.getModel();
// 		final XCalendarTheme theme = model.getTheme();
// 		final Transform t = new Transform(gc.getDevice());
// 		
// 		//
// 		try (final XCalendarFrame frame = new XCalendarFrame(gc, t)) {
// 			//
// 			Rectangle area = new Rectangle((area = popup.getClientArea()).x, area.y, area.width - 1, area.height - 1);
// 			gc.setAdvanced(true);
// 			gc.setAntialias(SWT.ON);
// 			gc.setBackground(theme.getBackground(true, false, false, false));
// 			gc.fillRectangle(area); gc.setForeground(theme.getGrid(true)); gc.drawRectangle(area);
// 			
// 			List<XCalendarWidget> widgets = popup.getWidgets();
// 			for(XCalendarWidget widget:widgets) widget.render(frame);
// 		}
// 	}
// }


import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.layout.XCalendarLayout;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.layout.impl.XCalendarDefaultLayout;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.render.XCalendarRender;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.render.impl.XCalendarDefaultRender;
package cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config;


/**
 * 
 * @author Jingqi Xu
 */
public class XCalendarConfig {
	//
	protected XCalendarLayout layout;
	protected XCalendarRender render;
	
	/**
	 * 
	 */
	public XCalendarConfig() {
// Path: src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/layout/XCalendarLayout.java
// public interface XCalendarLayout {
// 	
// 	/**
// 	 * 
// 	 */
// 	void layout(XCalendar calendar);
// 	
// 	void layout(XCalendar calendar, Composite parent, Rectangle bounds);
// }
// 
// Path: src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/layout/impl/XCalendarDefaultLayout.java
// public class XCalendarDefaultLayout implements XCalendarLayout {
// 	//
// 	private Composite prevParent;
// 	private Rectangle prevBounds;
// 	
// 	/**
// 	 * 
// 	 */
// 	@Override
// 	public void layout(XCalendar popup) {
// 		layout(popup, this.prevParent, this.prevBounds);
// 	}
// 	
// 	/**
// 	 * 
// 	 */
// 	@Override
// 	public void layout(XCalendar popup, Composite parent, Rectangle bounds) {
// 		//
// 		this.prevParent = parent;
// 		this.prevBounds = bounds;
// 		final XCalendarModel model = popup.getModel();
// 		final XCalendarTheme theme = model.getTheme();
// 		int x = theme.getMargin(), y = theme.getMargin();
// 		int m = theme.getMargin(), w = theme.getWidth() - 2 * m;
// 		
// 		//
// 		List<XCalendarWidget> widgets = popup.getWidgets();
// 		for(int i = 0; i < widgets.size(); i++) {
// 			final XCalendarWidget v = widgets.get(i);
// 			final Pair<Point> points = v.locate(x, y, w, m);
// 			v.setBounds(x, y, points.getV1().x, points.getV1().y);
// 			x = points.getV2().x; y = points.getV2().y;
// 		}
// 		
// 		//
// 		final Shell shell = popup.getShell();
// 		shell.setSize(new Point(theme.getWidth(), y + m)); setLocation(popup);
// 	}
// 
// 	/**
// 	 * 
// 	 */
// 	protected void setLocation(final XCalendar popup) {
// 		//
// 		final Shell shell = popup.getShell();
// 		final Display display = popup.getDisplay();
// 		final Rectangle r1 = display.map(prevParent, null, prevBounds);
// 		final Rectangle r2 = popup.getMonitor().getClientArea(); // Client area
// 		
// 		//
// 		final int margin = 2;
// 		final Point size = shell.getSize();
// 		int x = r1.x, y = r1.y + r1.height + margin;
// 		if(y + size.y > r2.y + r2.height) y = r1.y - size.y - margin;
// 		if(x < r2.x) x = r2.x; else if(x + size.x > r2.x + r2.width) x = r2.x + r2.width - size.x;
// 		shell.setLocation(x, y);
// 	}
// }
// 
// Path: src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/render/XCalendarRender.java
// public interface XCalendarRender {
// 	void render(XCalendar popup, GC gc);
// }
// 
// Path: src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/render/impl/XCalendarDefaultRender.java
// public class XCalendarDefaultRender implements XCalendarRender {
// 	
// 	public void render(XCalendar popup, GC gc) {
// 		final XCalendarModel model = popup.getModel();
// 		final XCalendarTheme theme = model.getTheme();
// 		final Transform t = new Transform(gc.getDevice());
// 		
// 		//
// 		try (final XCalendarFrame frame = new XCalendarFrame(gc, t)) {
// 			//
// 			Rectangle area = new Rectangle((area = popup.getClientArea()).x, area.y, area.width - 1, area.height - 1);
// 			gc.setAdvanced(true);
// 			gc.setAntialias(SWT.ON);
// 			gc.setBackground(theme.getBackground(true, false, false, false));
// 			gc.fillRectangle(area); gc.setForeground(theme.getGrid(true)); gc.drawRectangle(area);
// 			
// 			List<XCalendarWidget> widgets = popup.getWidgets();
// 			for(XCalendarWidget widget:widgets) widget.render(frame);
// 		}
// 	}
// }


// Path: src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/XCalendarConfig.java
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.layout.XCalendarLayout;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.layout.impl.XCalendarDefaultLayout;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.render.XCalendarRender;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.render.impl.XCalendarDefaultRender;

package cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config;


/**
 * 
 * @author Jingqi Xu
 */
public class XCalendarConfig {
	//
	protected XCalendarLayout layout;
	protected XCalendarRender render;
	
	/**
	 * 
	 */
	public XCalendarConfig() {
		this.layout = new XCalendarDefaultLayout();