Java Code Examples for ims.clinicaladmin.vo.MuscleGroupsVo

The following are top voted examples for showing how to use ims.clinicaladmin.vo.MuscleGroupsVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCancelMusclesClick() throws ims.framework.exceptions.PresentationLogicException
{
	clearSelectionTab();
	if (form.grdMotorArea().getSelectedRowIndex() > 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}

	form.setMode(FormMode.VIEW);
	enableContextMenu();
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCancelNewMuscleClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.grdMotorArea().getSelectedRowIndex() > 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}

	form.setMode(FormMode.VIEW);
	enableContextMenu();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void unlinkMuscle()
{
	if(form.grdMotorArea().getSelectedRow()!=null && form.grdMotorArea().getSelectedRow().getParentRow()!=null
			&& form.grdMotorArea().getSelectedRow().getParentRow().getParentRow()!=null
			&& form.grdMotorArea().getSelectedRow().getParentRow().getValue() !=null){
	
		MotorAreaVo motorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getParentRow().getValue();		
		MuscleGroupsVo muscleGroupsVo = (MuscleGroupsVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
		MuscleGroupMuscleVoCollection voCollMuscleGroupAssociations = muscleGroupsVo.getMuscleGroupMuscle();

		for (int j=0; j < voCollMuscleGroupAssociations.size(); j++)
		{
			if (voCollMuscleGroupAssociations.get(j).getMuscle().equals(form.getLocalContext().getSelectedMuscle()))
			{	
				voCollMuscleGroupAssociations.remove(j);
			}
		}
		
		motorAreaVo.getMuscleGroups().set(motorAreaVo.getMuscleGroups().indexOf(muscleGroupsVo), muscleGroupsVo);
		
		saveMotorArea(motorAreaVo);		
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setSelectedGroup()
{
	boolean bRowSelected = false;
	GenForm.grdMotorAreaRow[] rows = form.grdMotorArea().getAllRows();
	
	for (int i=0; i < rows.length; i++)
	{
		if (rows[i].getValue() instanceof MuscleGroupsVo)
		{
			if (rows[i].getValue().equals(form.getLocalContext().getSelectedMuscleGroup()))
			{	
				form.grdMotorArea().setValue(form.getLocalContext().getSelectedMuscleGroup());
				bRowSelected = true;
			}
		}
	}

	clearContextVariables();
	if (bRowSelected)
		onSelectGroup();					
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow findGroupRow(MotorChartDetailsVo voDetail)
{
	DynamicGridRow groupRow = null;
	for(int i=0; i < form.dyngrdMotor().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdMotor().getRows().get(i);
		if(row.getValue() instanceof MotorAreaVo)
		{
			for(int z=0; z<row.getRows().size(); z++)
			{
				DynamicGridRow gRow = row.getRows().get(z);
				if(gRow.getValue() instanceof MuscleGroupsVo)
				{
					MuscleGroupsVo voGroup = (MuscleGroupsVo) gRow.getValue();
					if(voGroup.getID_MuscleGroup().equals(voDetail.getMuscleGroup().getID_MuscleGroup()))
						groupRow = gRow;
				}
			}
		}
	}
	return groupRow;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCancelMusclesClick() throws ims.framework.exceptions.PresentationLogicException
{
	clearSelectionTab();
	if (form.grdMotorArea().getSelectedRowIndex() > 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}

	form.setMode(FormMode.VIEW);
	enableContextMenu();
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCancelNewMuscleClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.grdMotorArea().getSelectedRowIndex() > 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}

	form.setMode(FormMode.VIEW);
	enableContextMenu();
}
 
Example 8
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void unlinkMuscle()
{
	if(form.grdMotorArea().getSelectedRow()!=null && form.grdMotorArea().getSelectedRow().getParentRow()!=null
			&& form.grdMotorArea().getSelectedRow().getParentRow().getParentRow()!=null
			&& form.grdMotorArea().getSelectedRow().getParentRow().getValue() !=null){
	
		MotorAreaVo motorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getParentRow().getValue();		
		MuscleGroupsVo muscleGroupsVo = (MuscleGroupsVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
		MuscleGroupMuscleVoCollection voCollMuscleGroupAssociations = muscleGroupsVo.getMuscleGroupMuscle();

		for (int j=0; j < voCollMuscleGroupAssociations.size(); j++)
		{
			if (voCollMuscleGroupAssociations.get(j).getMuscle().equals(form.getLocalContext().getSelectedMuscle()))
			{	
				voCollMuscleGroupAssociations.remove(j);
			}
		}
		
		motorAreaVo.getMuscleGroups().set(motorAreaVo.getMuscleGroups().indexOf(muscleGroupsVo), muscleGroupsVo);
		
		saveMotorArea(motorAreaVo);		
	}
}
 
Example 9
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setSelectedGroup()
{
	boolean bRowSelected = false;
	GenForm.grdMotorAreaRow[] rows = form.grdMotorArea().getAllRows();
	
	for (int i=0; i < rows.length; i++)
	{
		if (rows[i].getValue() instanceof MuscleGroupsVo)
		{
			if (rows[i].getValue().equals(form.getLocalContext().getSelectedMuscleGroup()))
			{	
				form.grdMotorArea().setValue(form.getLocalContext().getSelectedMuscleGroup());
				bRowSelected = true;
			}
		}
	}

	clearContextVariables();
	if (bRowSelected)
		onSelectGroup();					
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow findGroupRow(MotorChartDetailsVo voDetail)
{
	DynamicGridRow groupRow = null;
	for(int i=0; i < form.dyngrdMotor().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdMotor().getRows().get(i);
		if(row.getValue() instanceof MotorAreaVo)
		{
			for(int z=0; z<row.getRows().size(); z++)
			{
				DynamicGridRow gRow = row.getRows().get(z);
				if(gRow.getValue() instanceof MuscleGroupsVo)
				{
					MuscleGroupsVo voGroup = (MuscleGroupsVo) gRow.getValue();
					if(voGroup.getID_MuscleGroup().equals(voDetail.getMuscleGroup().getID_MuscleGroup()))
						groupRow = gRow;
				}
			}
		}
	}
	return groupRow;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCancelMusclesClick() throws ims.framework.exceptions.PresentationLogicException
{
	clearSelectionTab();
	if (form.grdMotorArea().getSelectedRowIndex() > 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}

	form.setMode(FormMode.VIEW);
	enableContextMenu();
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCancelNewMuscleClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.grdMotorArea().getSelectedRowIndex() > 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}

	form.setMode(FormMode.VIEW);
	enableContextMenu();
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void unlinkMuscle()
{
	if(form.grdMotorArea().getSelectedRow()!=null && form.grdMotorArea().getSelectedRow().getParentRow()!=null
			&& form.grdMotorArea().getSelectedRow().getParentRow().getParentRow()!=null
			&& form.grdMotorArea().getSelectedRow().getParentRow().getValue() !=null){
	
		MotorAreaVo motorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getParentRow().getValue();		
		MuscleGroupsVo muscleGroupsVo = (MuscleGroupsVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
		MuscleGroupMuscleVoCollection voCollMuscleGroupAssociations = muscleGroupsVo.getMuscleGroupMuscle();

		for (int j=0; j < voCollMuscleGroupAssociations.size(); j++)
		{
			if (voCollMuscleGroupAssociations.get(j).getMuscle().equals(form.getLocalContext().getSelectedMuscle()))
			{	
				voCollMuscleGroupAssociations.remove(j);
			}
		}
		
		motorAreaVo.getMuscleGroups().set(motorAreaVo.getMuscleGroups().indexOf(muscleGroupsVo), muscleGroupsVo);
		
		saveMotorArea(motorAreaVo);		
	}
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setSelectedGroup()
{
	boolean bRowSelected = false;
	GenForm.grdMotorAreaRow[] rows = form.grdMotorArea().getAllRows();
	
	for (int i=0; i < rows.length; i++)
	{
		if (rows[i].getValue() instanceof MuscleGroupsVo)
		{
			if (rows[i].getValue().equals(form.getLocalContext().getSelectedMuscleGroup()))
			{	
				form.grdMotorArea().setValue(form.getLocalContext().getSelectedMuscleGroup());
				bRowSelected = true;
			}
		}
	}

	clearContextVariables();
	if (bRowSelected)
		onSelectGroup();					
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow findGroupRow(MotorChartDetailsVo voDetail)
{
	DynamicGridRow groupRow = null;
	for(int i=0; i < form.dyngrdMotor().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdMotor().getRows().get(i);
		if(row.getValue() instanceof MotorAreaVo)
		{
			for(int z=0; z<row.getRows().size(); z++)
			{
				DynamicGridRow gRow = row.getRows().get(z);
				if(gRow.getValue() instanceof MuscleGroupsVo)
				{
					MuscleGroupsVo voGroup = (MuscleGroupsVo) gRow.getValue();
					if(voGroup.getID_MuscleGroup().equals(voDetail.getMuscleGroup().getID_MuscleGroup()))
						groupRow = gRow;
				}
			}
		}
	}
	return groupRow;
}
 
Example 16
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCancelMusclesClick() throws ims.framework.exceptions.PresentationLogicException
{
	clearSelectionTab();
	if (form.grdMotorArea().getSelectedRowIndex() > 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}

	form.setMode(FormMode.VIEW);
	enableContextMenu();
}
 
Example 17
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCancelNewMuscleClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.grdMotorArea().getSelectedRowIndex() > 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}

	form.setMode(FormMode.VIEW);
	enableContextMenu();
}
 
Example 18
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void unlinkMuscle()
{
	if(form.grdMotorArea().getSelectedRow()!=null && form.grdMotorArea().getSelectedRow().getParentRow()!=null
			&& form.grdMotorArea().getSelectedRow().getParentRow().getParentRow()!=null
			&& form.grdMotorArea().getSelectedRow().getParentRow().getValue() !=null){
	
		MotorAreaVo motorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getParentRow().getValue();		
		MuscleGroupsVo muscleGroupsVo = (MuscleGroupsVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
		MuscleGroupMuscleVoCollection voCollMuscleGroupAssociations = muscleGroupsVo.getMuscleGroupMuscle();

		for (int j=0; j < voCollMuscleGroupAssociations.size(); j++)
		{
			if (voCollMuscleGroupAssociations.get(j).getMuscle().equals(form.getLocalContext().getSelectedMuscle()))
			{	
				voCollMuscleGroupAssociations.remove(j);
			}
		}
		
		motorAreaVo.getMuscleGroups().set(motorAreaVo.getMuscleGroups().indexOf(muscleGroupsVo), muscleGroupsVo);
		
		saveMotorArea(motorAreaVo);		
	}
}
 
Example 19
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setSelectedGroup()
{
	boolean bRowSelected = false;
	GenForm.grdMotorAreaRow[] rows = form.grdMotorArea().getAllRows();
	
	for (int i=0; i < rows.length; i++)
	{
		if (rows[i].getValue() instanceof MuscleGroupsVo)
		{
			if (rows[i].getValue().equals(form.getLocalContext().getSelectedMuscleGroup()))
			{	
				form.grdMotorArea().setValue(form.getLocalContext().getSelectedMuscleGroup());
				bRowSelected = true;
			}
		}
	}

	clearContextVariables();
	if (bRowSelected)
		onSelectGroup();					
}
 
Example 20
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow findGroupRow(MotorChartDetailsVo voDetail)
{
	DynamicGridRow groupRow = null;
	for(int i=0; i < form.dyngrdMotor().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdMotor().getRows().get(i);
		if(row.getValue() instanceof MotorAreaVo)
		{
			for(int z=0; z<row.getRows().size(); z++)
			{
				DynamicGridRow gRow = row.getRows().get(z);
				if(gRow.getValue() instanceof MuscleGroupsVo)
				{
					MuscleGroupsVo voGroup = (MuscleGroupsVo) gRow.getValue();
					if(voGroup.getID_MuscleGroup().equals(voDetail.getMuscleGroup().getID_MuscleGroup()))
						groupRow = gRow;
				}
			}
		}
	}
	return groupRow;
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open()
{	
	if (form.cmbFilter().getValue() != null)
	{
		if (form.cmbFilter().getValue().equals(FILTER_ALL))
		{
			listAreas();
			form.grdMotorArea().setColAreasCaption("Motor Area/Muscle Groups/Muscles");
		}
		if (form.cmbFilter().getValue().equals(FILTER_MUSCLE))
		{
			listAllMuscle();	
			form.grdMotorArea().setColAreasCaption("Muscles");
		}
	}
	
	//reSelectSavedItem();

	if (form.grdMotorArea().getSelectedRowIndex() >= 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}
	
	//form.grdMotorArea().setValue(null);
	enableContextMenu();
	
	form.setMode(FormMode.VIEW);
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void selectionChanged()
{
	enableContextMenu();
	
	Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
	if (gridObjectSelected instanceof MuscleVo)
		onSelectMuscle();
	
	if (gridObjectSelected instanceof MotorAreaVo)
		onSelectArea();
	
	if (gridObjectSelected instanceof MuscleGroupsVo)
		onSelectGroup();
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onMoveDown() 
{
	boolean gridRecordSelected = false;
	Object gridObjectSelected = null;
	if (form.grdMotorArea().getSelectedRow() != null)
	{
		gridRecordSelected = form.grdMotorArea().getSelectedRow().getValue() != null;
		gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
	}

	if (gridRecordSelected)
	{						
		if (gridObjectSelected instanceof MuscleGroupsVo)
		{
			MotorAreaVo tempMotorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
			if(tempMotorAreaVo != null && tempMotorAreaVo.getMuscleGroupsIsNotNull() && tempMotorAreaVo.getMuscleGroups().size() > 0 )
			{
				int index = tempMotorAreaVo.getMuscleGroups().indexOf((MuscleGroupsVo)gridObjectSelected);
				int sizeColl = tempMotorAreaVo.getMuscleGroups().size();
				if(index < (sizeColl-1))
				{
					MuscleGroupsVo tempMuscleGroupsVo = tempMotorAreaVo.getMuscleGroups().get(index + 1);
					tempMotorAreaVo.getMuscleGroups().set(index + 1 , (MuscleGroupsVo)gridObjectSelected);
					tempMotorAreaVo.getMuscleGroups().set(index  , tempMuscleGroupsVo);
					saveMotorArea(tempMotorAreaVo);
				}					
			}
		}
	}
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onMoveUp() 
{
	
	boolean gridRecordSelected = false;
	Object gridObjectSelected = null;
	if (form.grdMotorArea().getSelectedRow() != null)
	{
		gridRecordSelected = form.grdMotorArea().getSelectedRow().getValue() != null;
		gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
	}

	if (gridRecordSelected)
	{
					
		if (gridObjectSelected instanceof MuscleGroupsVo)
		{
			MotorAreaVo tempMotorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
			if(tempMotorAreaVo != null && tempMotorAreaVo.getMuscleGroupsIsNotNull() && tempMotorAreaVo.getMuscleGroups().size() > 0 )
			{
				int index = tempMotorAreaVo.getMuscleGroups().indexOf((MuscleGroupsVo)gridObjectSelected);
				if(index > 0)
				{
					MuscleGroupsVo tempMuscleGroupsVo = tempMotorAreaVo.getMuscleGroups().get(index -1);
					tempMotorAreaVo.getMuscleGroups().set(index - 1 , (MuscleGroupsVo)gridObjectSelected);
					tempMotorAreaVo.getMuscleGroups().set(index  , tempMuscleGroupsVo);
					saveMotorArea(tempMotorAreaVo);
				}					
			}
		}
	}

}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onAddMuscle() 
{
	form.lyrTabs().showtabMuscleSelection();
	clearSelectionTab();

	if ( (form.grdMotorArea().getSelectedRow().getValue() != null) 
		&& (form.grdMotorArea().getSelectedRow().getValue() instanceof MuscleGroupsVo))
	{
		form.getLocalContext().setSelectedMuscleGroup((MuscleGroupsVo)form.grdMotorArea().getSelectedRow().getValue());			
		form.getLocalContext().setSelectedMotorArea((MotorAreaVo)form.grdMotorArea().getSelectedRow().getParentRow().getValue());
	}
	
	form.setMode(FormMode.EDIT);
	form.lyrTabs().tabMuscleSelection().imbMuscleSearch().setAsDefaultButton();
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onRemoveGroup() 
{
	if (form.getLocalContext().getSelectedMotorArea() == null)
		return;
	if (form.getLocalContext().getSelectedMuscleGroup() == null)
		return;
	
	MotorAreaVo voMotorArea = form.getLocalContext().getSelectedMotorArea(); 
	MuscleGroupsVo voMuscleGroup = form.getLocalContext().getSelectedMuscleGroup();
	
	boolean bChanged = false;
	for (int i=0; i < voMotorArea.getMuscleGroups().size(); i++)
	{
		if (voMotorArea.getMuscleGroups().get(i).equals(voMuscleGroup))
		{
			voMotorArea.getMuscleGroups().get(i).setIsActive(Boolean.FALSE);
			bChanged = true;
			break;
		}
	}
			
	if (bChanged == true)
	{
		saveMotorArea(voMotorArea);
		clearGroupControls();
	}
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onSelectGroup() 
{
	form.lyrTabs().showtabMuscleGroup();
	form.getLocalContext().setSelectedMuscleGroup((MuscleGroupsVo)form.grdMotorArea().getSelectedRow().getValue());
	form.getLocalContext().setSelectedMotorArea((MotorAreaVo)form.grdMotorArea().getSelectedRow().getParentRow().getValue());
	populateGroupTab((MuscleGroupsVo)form.grdMotorArea().getSelectedRow().getValue());
}
 
Example 28
Project: AvoinApotti   File: MuscleAreaGroupsMusclesImpl.java   Source Code and License 5 votes vote down vote up
public MuscleGroupsVo getMuscles(MuscleGroupsVo voGroup)
{
	if(voGroup == null)
		throw new DomainRuntimeException("Muscle Group Filter not provided for get call. ");

	DomainFactory factory = getDomainFactory();	
	String hql = " from MuscleGroupMuscle mgm "; 
	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();

	condStr.append(andStr + " mgm.muslceGroup.id = :groupid"); 
	markers.add("groupid");
	values.add(voGroup.getID_MuscleGroup());
	andStr = " and ";
	
	if (andStr.equals(" and "))
		hql += " where ";

	hql += condStr.toString();
	MuscleGroupMuscleVoCollection voColl = MuscleGroupMuscleVoAssembler.createMuscleGroupMuscleVoCollectionFromMuscleGroupMuscle(factory.find(hql, markers, values)).sort();

	if(voColl != null && voColl.size()>0)
		voGroup.setMuscleGroupMuscle(voColl);
	
	return voGroup;
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open()
{	
	if (form.cmbFilter().getValue() != null)
	{
		if (form.cmbFilter().getValue().equals(FILTER_ALL))
		{
			listAreas();
			form.grdMotorArea().setColAreasCaption("Motor Area/Muscle Groups/Muscles");
		}
		if (form.cmbFilter().getValue().equals(FILTER_MUSCLE))
		{
			listAllMuscle();	
			form.grdMotorArea().setColAreasCaption("Muscles");
		}
	}
	
	//reSelectSavedItem();

	if (form.grdMotorArea().getSelectedRowIndex() >= 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}
	
	//form.grdMotorArea().setValue(null);
	enableContextMenu();
	
	form.setMode(FormMode.VIEW);
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void selectionChanged()
{
	enableContextMenu();
	
	Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
	if (gridObjectSelected instanceof MuscleVo)
		onSelectMuscle();
	
	if (gridObjectSelected instanceof MotorAreaVo)
		onSelectArea();
	
	if (gridObjectSelected instanceof MuscleGroupsVo)
		onSelectGroup();
}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onMoveDown() 
{
	boolean gridRecordSelected = false;
	Object gridObjectSelected = null;
	if (form.grdMotorArea().getSelectedRow() != null)
	{
		gridRecordSelected = form.grdMotorArea().getSelectedRow().getValue() != null;
		gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
	}

	if (gridRecordSelected)
	{						
		if (gridObjectSelected instanceof MuscleGroupsVo)
		{
			MotorAreaVo tempMotorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
			if(tempMotorAreaVo != null && tempMotorAreaVo.getMuscleGroupsIsNotNull() && tempMotorAreaVo.getMuscleGroups().size() > 0 )
			{
				int index = tempMotorAreaVo.getMuscleGroups().indexOf((MuscleGroupsVo)gridObjectSelected);
				int sizeColl = tempMotorAreaVo.getMuscleGroups().size();
				if(index < (sizeColl-1))
				{
					MuscleGroupsVo tempMuscleGroupsVo = tempMotorAreaVo.getMuscleGroups().get(index + 1);
					tempMotorAreaVo.getMuscleGroups().set(index + 1 , (MuscleGroupsVo)gridObjectSelected);
					tempMotorAreaVo.getMuscleGroups().set(index  , tempMuscleGroupsVo);
					saveMotorArea(tempMotorAreaVo);
				}					
			}
		}
	}
}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onMoveUp() 
{
	
	boolean gridRecordSelected = false;
	Object gridObjectSelected = null;
	if (form.grdMotorArea().getSelectedRow() != null)
	{
		gridRecordSelected = form.grdMotorArea().getSelectedRow().getValue() != null;
		gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
	}

	if (gridRecordSelected)
	{
					
		if (gridObjectSelected instanceof MuscleGroupsVo)
		{
			MotorAreaVo tempMotorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
			if(tempMotorAreaVo != null && tempMotorAreaVo.getMuscleGroupsIsNotNull() && tempMotorAreaVo.getMuscleGroups().size() > 0 )
			{
				int index = tempMotorAreaVo.getMuscleGroups().indexOf((MuscleGroupsVo)gridObjectSelected);
				if(index > 0)
				{
					MuscleGroupsVo tempMuscleGroupsVo = tempMotorAreaVo.getMuscleGroups().get(index -1);
					tempMotorAreaVo.getMuscleGroups().set(index - 1 , (MuscleGroupsVo)gridObjectSelected);
					tempMotorAreaVo.getMuscleGroups().set(index  , tempMuscleGroupsVo);
					saveMotorArea(tempMotorAreaVo);
				}					
			}
		}
	}

}
 
Example 33
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onAddMuscle() 
{
	form.lyrTabs().showtabMuscleSelection();
	clearSelectionTab();

	if ( (form.grdMotorArea().getSelectedRow().getValue() != null) 
		&& (form.grdMotorArea().getSelectedRow().getValue() instanceof MuscleGroupsVo))
	{
		form.getLocalContext().setSelectedMuscleGroup((MuscleGroupsVo)form.grdMotorArea().getSelectedRow().getValue());			
		form.getLocalContext().setSelectedMotorArea((MotorAreaVo)form.grdMotorArea().getSelectedRow().getParentRow().getValue());
	}
	
	form.setMode(FormMode.EDIT);
	form.lyrTabs().tabMuscleSelection().imbMuscleSearch().setAsDefaultButton();
}
 
Example 34
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onRemoveGroup() 
{
	if (form.getLocalContext().getSelectedMotorArea() == null)
		return;
	if (form.getLocalContext().getSelectedMuscleGroup() == null)
		return;
	
	MotorAreaVo voMotorArea = form.getLocalContext().getSelectedMotorArea(); 
	MuscleGroupsVo voMuscleGroup = form.getLocalContext().getSelectedMuscleGroup();
	
	boolean bChanged = false;
	for (int i=0; i < voMotorArea.getMuscleGroups().size(); i++)
	{
		if (voMotorArea.getMuscleGroups().get(i).equals(voMuscleGroup))
		{
			voMotorArea.getMuscleGroups().get(i).setIsActive(Boolean.FALSE);
			bChanged = true;
			break;
		}
	}
			
	if (bChanged == true)
	{
		saveMotorArea(voMotorArea);
		clearGroupControls();
	}
}
 
Example 35
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onSelectGroup() 
{
	form.lyrTabs().showtabMuscleGroup();
	form.getLocalContext().setSelectedMuscleGroup((MuscleGroupsVo)form.grdMotorArea().getSelectedRow().getValue());
	form.getLocalContext().setSelectedMotorArea((MotorAreaVo)form.grdMotorArea().getSelectedRow().getParentRow().getValue());
	populateGroupTab((MuscleGroupsVo)form.grdMotorArea().getSelectedRow().getValue());
}
 
Example 36
Project: openMAXIMS   File: MuscleAreaGroupsMusclesImpl.java   Source Code and License 5 votes vote down vote up
public MuscleGroupsVo getMuscles(MuscleGroupsVo voGroup)
{
	if(voGroup == null)
		throw new DomainRuntimeException("Muscle Group Filter not provided for get call. ");

	DomainFactory factory = getDomainFactory();	
	String hql = " from MuscleGroupMuscle mgm "; 
	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();

	condStr.append(andStr + " mgm.muslceGroup.id = :groupid"); 
	markers.add("groupid");
	values.add(voGroup.getID_MuscleGroup());
	andStr = " and ";
	
	if (andStr.equals(" and "))
		hql += " where ";

	hql += condStr.toString();
	MuscleGroupMuscleVoCollection voColl = MuscleGroupMuscleVoAssembler.createMuscleGroupMuscleVoCollectionFromMuscleGroupMuscle(factory.find(hql, markers, values)).sort();

	if(voColl != null && voColl.size()>0)
		voGroup.setMuscleGroupMuscle(voColl);
	
	return voGroup;
}
 
Example 37
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open()
{	
	if (form.cmbFilter().getValue() != null)
	{
		if (form.cmbFilter().getValue().equals(FILTER_ALL))
		{
			listAreas();
			form.grdMotorArea().setColAreasCaption("Motor Area/Muscle Groups/Muscles");
		}
		if (form.cmbFilter().getValue().equals(FILTER_MUSCLE))
		{
			listAllMuscle();	
			form.grdMotorArea().setColAreasCaption("Muscles");
		}
	}
	
	//reSelectSavedItem();

	if (form.grdMotorArea().getSelectedRowIndex() >= 0)
	{
		Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
		if (gridObjectSelected instanceof MuscleVo)
			onSelectMuscle();

		if (gridObjectSelected instanceof MotorAreaVo)
			onSelectArea();
	
		if (gridObjectSelected instanceof MuscleGroupsVo)
			onSelectGroup();
	}
	
	//form.grdMotorArea().setValue(null);
	enableContextMenu();
	
	form.setMode(FormMode.VIEW);
}
 
Example 38
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void selectionChanged()
{
	enableContextMenu();
	
	Object gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
	if (gridObjectSelected instanceof MuscleVo)
		onSelectMuscle();
	
	if (gridObjectSelected instanceof MotorAreaVo)
		onSelectArea();
	
	if (gridObjectSelected instanceof MuscleGroupsVo)
		onSelectGroup();
}
 
Example 39
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onMoveDown() 
{
	boolean gridRecordSelected = false;
	Object gridObjectSelected = null;
	if (form.grdMotorArea().getSelectedRow() != null)
	{
		gridRecordSelected = form.grdMotorArea().getSelectedRow().getValue() != null;
		gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
	}

	if (gridRecordSelected)
	{						
		if (gridObjectSelected instanceof MuscleGroupsVo)
		{
			MotorAreaVo tempMotorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
			if(tempMotorAreaVo != null && tempMotorAreaVo.getMuscleGroupsIsNotNull() && tempMotorAreaVo.getMuscleGroups().size() > 0 )
			{
				int index = tempMotorAreaVo.getMuscleGroups().indexOf((MuscleGroupsVo)gridObjectSelected);
				int sizeColl = tempMotorAreaVo.getMuscleGroups().size();
				if(index < (sizeColl-1))
				{
					MuscleGroupsVo tempMuscleGroupsVo = tempMotorAreaVo.getMuscleGroups().get(index + 1);
					tempMotorAreaVo.getMuscleGroups().set(index + 1 , (MuscleGroupsVo)gridObjectSelected);
					tempMotorAreaVo.getMuscleGroups().set(index  , tempMuscleGroupsVo);
					saveMotorArea(tempMotorAreaVo);
				}					
			}
		}
	}
}
 
Example 40
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void onMoveUp() 
{
	
	boolean gridRecordSelected = false;
	Object gridObjectSelected = null;
	if (form.grdMotorArea().getSelectedRow() != null)
	{
		gridRecordSelected = form.grdMotorArea().getSelectedRow().getValue() != null;
		gridObjectSelected = form.grdMotorArea().getSelectedRow().getValue();
	}

	if (gridRecordSelected)
	{
					
		if (gridObjectSelected instanceof MuscleGroupsVo)
		{
			MotorAreaVo tempMotorAreaVo = (MotorAreaVo) form.grdMotorArea().getSelectedRow().getParentRow().getValue();
			if(tempMotorAreaVo != null && tempMotorAreaVo.getMuscleGroupsIsNotNull() && tempMotorAreaVo.getMuscleGroups().size() > 0 )
			{
				int index = tempMotorAreaVo.getMuscleGroups().indexOf((MuscleGroupsVo)gridObjectSelected);
				if(index > 0)
				{
					MuscleGroupsVo tempMuscleGroupsVo = tempMotorAreaVo.getMuscleGroups().get(index -1);
					tempMotorAreaVo.getMuscleGroups().set(index - 1 , (MuscleGroupsVo)gridObjectSelected);
					tempMotorAreaVo.getMuscleGroups().set(index  , tempMuscleGroupsVo);
					saveMotorArea(tempMotorAreaVo);
				}					
			}
		}
	}

}