ItEr48S04ValidacionEProbasFuncionaisItEr47S04 : Adjustment of the zoom size when it shows the company view mode after apply filters.
This commit is contained in:
parent
b1b1249656
commit
a3ab6e818f
4 changed files with 22 additions and 5 deletions
|
|
@ -57,9 +57,10 @@ import org.zkoss.zk.ui.HtmlMacroComponent;
|
|||
import org.zkoss.zk.ui.util.Clients;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.ListModel;
|
||||
import org.zkoss.zul.Listbox;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.Separator;
|
||||
import org.zkoss.zul.SimpleListModel;
|
||||
import org.zkoss.zul.api.Listbox;
|
||||
|
||||
public class Planner extends HtmlMacroComponent {
|
||||
|
||||
|
|
@ -110,6 +111,8 @@ public class Planner extends HtmlMacroComponent {
|
|||
|
||||
private GanttPanel ganttPanel;
|
||||
|
||||
private boolean fixedZoomByUser = false;
|
||||
|
||||
private List<? extends CommandContextualized<?>> contextualizedGlobalCommands;
|
||||
|
||||
private CommandContextualized<?> goingDownInLastArrowCommand;
|
||||
|
|
@ -193,10 +196,11 @@ public class Planner extends HtmlMacroComponent {
|
|||
}
|
||||
|
||||
public void setZoomLevel(final ZoomLevel zoomLevel) {
|
||||
|
||||
if (ganttPanel == null) {
|
||||
return;
|
||||
}
|
||||
this.fixedZoomByUser = true;
|
||||
initialZoomLevel = zoomLevel;
|
||||
ganttPanel.setZoomLevel(zoomLevel);
|
||||
}
|
||||
|
||||
|
|
@ -468,8 +472,8 @@ public class Planner extends HtmlMacroComponent {
|
|||
return ganttPanel.getTimeTracker().getDetailLevel();
|
||||
}
|
||||
|
||||
public boolean isInitialZoomLevelAlreadySet() {
|
||||
return this.initialZoomLevel != null;
|
||||
public boolean isFixedZoomByUser() {
|
||||
return this.fixedZoomByUser;
|
||||
}
|
||||
|
||||
public void setInitialZoomLevel(final ZoomLevel zoomLevel) {
|
||||
|
|
@ -498,4 +502,12 @@ public class Planner extends HtmlMacroComponent {
|
|||
}
|
||||
}
|
||||
|
||||
public void updateSelectedZoomLevel() {
|
||||
if (!isFixedZoomByUser()) {
|
||||
Listitem selectedItem = (Listitem) listZoomLevels.getItems().get(
|
||||
initialZoomLevel.ordinal());
|
||||
listZoomLevels.setSelectedItem(selectedItem);
|
||||
listZoomLevels.invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ public class CompanyPlanningController implements Composer{
|
|||
model
|
||||
.setConfigurationToPlanner(planner, additional,
|
||||
doubleClickCommand, createPredicate());
|
||||
planner.updateSelectedZoomLevel();
|
||||
planner.invalidate();
|
||||
}
|
||||
|
||||
public void setAdditional(List<ICommandOnTask<TaskElement>> additional) {
|
||||
|
|
@ -160,6 +162,7 @@ public class CompanyPlanningController implements Composer{
|
|||
// Recalculate predicate
|
||||
model.setConfigurationToPlanner(planner, additional,
|
||||
doubleClickCommand, predicate);
|
||||
planner.updateSelectedZoomLevel();
|
||||
planner.invalidate();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ public class OrderPlanningController implements Composer {
|
|||
private void updateConfiguration() {
|
||||
model.setConfigurationToPlanner(planner, order, viewSwitcher,
|
||||
editTaskController, calendarAllocationController, additional);
|
||||
planner.updateSelectedZoomLevel();
|
||||
}
|
||||
|
||||
public EditTaskController getEditTaskController() {
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
|
||||
public static void configureInitialZoomLevelFor(Planner planner,
|
||||
ZoomLevel defaultZoomLevel) {
|
||||
if (!planner.isInitialZoomLevelAlreadySet()) {
|
||||
if (!planner.isFixedZoomByUser()) {
|
||||
planner.setInitialZoomLevel(defaultZoomLevel);
|
||||
}
|
||||
}
|
||||
|
|
@ -243,6 +243,7 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
orderReloaded = reload(order);
|
||||
PlannerConfiguration<TaskElement> configuration = createConfiguration(orderReloaded);
|
||||
addAdditional(additional, configuration);
|
||||
|
||||
ZoomLevel defaultZoomLevel = OrderPlanningModel
|
||||
.calculateDefaultLevel(configuration);
|
||||
configureInitialZoomLevelFor(planner, defaultZoomLevel);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue