亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? diagramentitycontainer.cpp

?? 大家用過UML的流程圖設(shè)計(jì)器吧
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/* ==========================================================================
	Class :			CDiagramEntityContainer

	Author :		Johan Rosengren, Abstrakt Mekanik AB

	Date :			2004-03-29

	Purpose :		"CDiagramEntityContainer" contains the data for a 
					"CDiagramEditor". It manages mass operations such as 
					copying, pasting and undo. It is completely separated 
					from "CDiagramEditor" to allow the package to be used 
					in a doc/view app. This is also the reason why some 
					functionality is accessible in both this class and 飊
					"CDiagramEditor".

	Description :	The class contains a "CObArray" with the instances of 
					"CDiagramEntity"-derived classes that is the current data 
					for an editor. It also contains a pointer to a 
					"CDiagramClipboardHandler"-instance that works as the 
					'clipboard' for an editor. Furthermore, It contains an
					"CObArray" of "CObArray"s that is the undo stack.

					The Undo-functionality is implemented as a simple FILO-stack 
					of "CObArray" pointers. Before any change that should be 
					undoable, "Snapshot" is called to add new entries to 
					the Undo-stack. This is normally managed by the editor, 
					and need only be done manually for added functionality.

					Note that the "CDiagramEntityContainer" should normally 
					not call "Snapshot" itself - in the case of, for example, 
					additions to "m_objs", the container can not and should 
					not know if it is an undoable operation.

	Usage :			Normally, this class need not be derived from. A 
					"CDiagramEditor" needs an instance of 
					"CDiagramEntityContainer" to hold the object data. This 
					instance can either be external, as for a doc/view app 
					where the container belongs to the document, or 
					internal, as for a dialog application where the editor 
					will manage all of the data. In the first case, a 
					"CDiagramEntityContainer" member should be declared in 
					the document class, and a pointer to it submitted to 
					the "Create"-call of the "CDiagramEditor" (or by calling 
					"CDiagramEditor::SetCDiagramEntityContainer"). In the 
					second case, nothing special need to be done - the 
					"CDiagramEntityContainer" will be created during the 
					"CDiagramEditor::Create" call automatically if no pointer 
					is submitted.
					
					The container is not using the Windows clipboard 
					(because of instantiation questions on derived 
					entities), but rather an external clipboard handler 
					derived from "CDiagramClipboardHandler". This handler is 
					set calling "SetClipboardHandler", and several containers 
					can share the same handler. If no clipboard handler is 
					set, a default internal one will be used.

					"CDiagramEntityContainer" manages all data internally, 
					all internal objects are deleted in the class "dtor".

   ========================================================================
	Changes :		19/4 2004	Made RemoveAt virtual.
					20/4 2004	Made several Undo- and Copy/Paste functions 
								virtual. Added array accessors for derived 
								classes. Moved the member function Find to 
								protected.
					30/4 2004	Copy/paste-handling removed to a separate 
								class to allow several containers to share 
								the same clipboard.
					30/4 2004	Changed c-style casts to static_cast
   ========================================================================
					20/5 2004	Made GetAt virtual
					30/5 2004	RemoveAll, added check to see if there are 
								any items in the object array.
					30/5 2004	Made RemoveAll access data container objects 
								directly, to avoid chained deletes in 
								derived classes.
   ========================================================================
					26/6 2004	Added group handling (Unruled Boy).
					3/7  2004	Made Add and Remove virtual
					3/7  2004	Added a GetSelectCount
   ========================================================================
					4/8  2004	Added SelectAll and UnselectAll
   ========================================================================
					11/12 2004	Made UnselectAll virtual (Grisha Vinevich)
   ========================================================================
					22/1  2005	Added PopUndo function to pop the latest 
								undo item from the stack
								Made IsUndoPossible const.
   ========================================================================*/

#include "stdafx.h"
#include "DiagramEntityContainer.h"
#include "DiagramEntity.h"
#include "Tokenizer.h"
#include "GroupFactory.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#pragma warning( disable : 4706 )

/////////////////////////////////////////////////////////////////////////////
// CDiagramEntityContainer construction/destruction/initialization

CDiagramEntityContainer::CDiagramEntityContainer( CDiagramClipboardHandler* clip )
/* ============================================================
	Function :		CDiagramEntityContainer::CDiagramEntityContainer
	Description :	Constructor
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			

   ============================================================*/
{

	m_clip = clip;

	SetUndoStackSize( 0 );
	Clear();
	SetVirtualSize( CSize( 0, 0 ) );

}

CDiagramEntityContainer::~CDiagramEntityContainer()
/* ============================================================
	Function :		CDiagramEntityContainer::~CDiagramEntityContainer
	Description :	Destructor
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			

   ============================================================*/
{

	Clear();

}

void CDiagramEntityContainer::Clear()
/* ============================================================
	Function :		CDiagramEntityContainer::Clear
	Description :	Removes all data from the data and undo.
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			Call to remove data from the container. The 
					Paste-array will be kept.

   ============================================================*/
{

	RemoveAll();
	ClearUndo();
	SetModified( FALSE );

}

CString CDiagramEntityContainer::GetString() const
/* ============================================================
	Function :		CDiagramEntityContainer::GetString
	Description :	Returns a string representation of the 
					virtual paper size
	Access :		Public

	Return :		CString	-	Resulting string
	Parameters :	none

	Usage :			Call to get a string representing the paper 
					size of the container. The format is 
					"paper:x,y;" where "x" and "y" are the 
					horisontal and vertical sizes.

   ============================================================*/
{

	CString str;
	str.Format( _T( "paper:%i,%i;" ), GetVirtualSize().cx, GetVirtualSize().cy );
	return str;

}

BOOL CDiagramEntityContainer::FromString( const CString& str )
/* ============================================================
	Function :		CDiagramEntityContainer::FromString
	Description :	Sets the virtual paper size from a string.
	Access :		Public

	Return :		BOOL				-	"TRUE" if the string 
											represented a 
											paper.
	Parameters :	const CString& str	-	The string 
											representation.
					
	Usage :			Call to set the paper size of the container 
					from a string. The format is "paper:x,y;" 
					where "x" and "y" are the horisontal and 
					vertical sizes.

   ============================================================*/
{

	BOOL result = FALSE;

	CTokenizer main( str, _T( ":" ) );
	CString header;
	CString data;
	if( main.GetSize() == 2 )
	{
		main.GetAt( 0, header );
		main.GetAt( 1, data );
		header.TrimLeft();
		header.TrimRight();
		data.TrimLeft();
		data.TrimRight();
		if( header == _T( "paper" ) )
		{
			CTokenizer tok( data.Left( data.GetLength() - 1 ) );
			int size = tok.GetSize();
			if( size == 2 )
			{
				int right;
				int bottom;

				tok.GetAt(0, right );
				tok.GetAt(1, bottom );

				SetVirtualSize( CSize( right, bottom ) );
				result = TRUE;
			}
		}
	}

	return result;

}

void CDiagramEntityContainer::Export( CStringArray& stra, UINT format ) const
/* ============================================================
	Function :		CDiagramEntityContainer::Export
	Description :	Exports all objects to format format.
	Access :		Public

	Return :		void
	Parameters :	CStringArray& stra	-	"CStingArray" that 
											will be filled with 
											data on return. 
					UINT format			-	Format to save to.
					
	Usage :			Call to export the contents of the container 
					to a "CStringArray". "Export" will - of course - 
					have to be defined for the derived objects.

   ============================================================*/
{

	int max = GetSize();
	for( int t = 0 ; t < max ; t++ )
	{
		CDiagramEntity* obj = GetAt( t );
		stra.Add( obj->Export( format ) );
	}

}

/////////////////////////////////////////////////////////////////////////////
// CDiagramEntityContainer data access

int CDiagramEntityContainer::GetSize() const
/* ============================================================
	Function :		CDiagramEntityContainer::GetSize
	Description :	Returns the number of objects in the data
					container.
	Access :		Public

	Return :		int		-	The number of objects.
	Parameters :	none

	Usage :			Call to get the number of objects currently 
					in the data array of the container.

   ============================================================*/
{

	return m_objs.GetSize();

}

void CDiagramEntityContainer::Add( CDiagramEntity* obj )
/* ============================================================
	Function :		CDiagramEntityContainer::Add
	Description :	Add an object to the data.
	Access :		Public

	Return :		void
	Parameters :	CDiagramEntity* obj	-	The object to add.
					
	Usage :			Call to add a new object to the container.

   ============================================================*/
{

	obj->SetParent( this );
	m_objs.Add( obj );
	SetModified( TRUE );

}

CDiagramEntity* CDiagramEntityContainer::GetAt( int index ) const
/* ============================================================
	Function :		CDiagramEntityContainer::GetAt
	Description :	Gets the object at position "index".
	Access :		Public

	Return :		CDiagramEntity*	-	The object or "NULL" if 
										out of range.
	Parameters :	int index		-	The index to get data 
										from
					
	Usage :			Call to get a specific object from the 
					container.

   ============================================================*/
{

	CDiagramEntity* result = NULL;
	if( index < m_objs.GetSize() && index >= 0 )
		result = static_cast< CDiagramEntity* >( m_objs.GetAt( index ) );
	return result;

}

void CDiagramEntityContainer::SetAt( int index, CDiagramEntity* obj )
/* ============================================================
	Function :		CDiagramEntityContainer::SetAt
	Description :	Sets an object at position "index".
	Access :		Public

	Return :		void
	Parameters :	int index			-	Index to set data 
											at.
					CDiagramEntity* obj	-	Object to set.
					
	Usage :			Internal function. Used by "Swap".

   ============================================================*/
{

	m_objs.SetAt( index, obj );
	SetModified( TRUE );

}

void CDiagramEntityContainer::RemoveAt( int index )
/* ============================================================
	Function :		CDiagramEntityContainer::RemoveAt
	Description :	Removes the object at index.
	Access :		Public

	Return :		void
	Parameters :	int index	-	The index of the object 
									to remove.
					
	Usage :			Call to remove a specific object. Memory is 
					freed.

   ============================================================*/
{

	CDiagramEntity* obj = GetAt( index );
	if( obj )
	{
		delete obj;
		m_objs.RemoveAt( index );
		SetModified( TRUE );
	}

}

void CDiagramEntityContainer::RemoveAll()
/* ============================================================
	Function :		CDiagramEntityContainer::RemoveAll
	Description :	Removes all data objects
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			Call to remove all data objects in the 
					container. Undo- and paste arrays are not 
					emptied.
					Allocated memory is released. Undo and 
					paste not deleted.

   ============================================================*/
{

	int max = m_objs.GetSize();
	if( max )
	{

		for( int t = 0 ; t < max ; t++ )
		{
			CDiagramEntity* obj = static_cast< CDiagramEntity* >( m_objs.GetAt( t ) );
			delete obj;
		}

		m_objs.RemoveAll();
		SetModified( TRUE );

	}

}

void CDiagramEntityContainer::RemoveAllSelected()
/* ============================================================
	Function :		CDiagramEntityContainer::RemoveAllSelected
	Description :	Removes all selected objects
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			Call to remove all selected objects from the 
					container. Releases allocated data

   ============================================================*/
{

	int max = m_objs.GetSize() - 1;
	for( int t = max ; t >= 0 ; t-- )
		if( GetAt( t )->IsSelected() )
			RemoveAt( t );

}

/////////////////////////////////////////////////////////////////////////////
// CDiagramEntityContainer property access

void CDiagramEntityContainer::SetVirtualSize( CSize size )
/* ============================================================
	Function :		CDiagramEntityContainer::SetVirtualSize
	Description :	Sets the current virtual paper size.
	Access :		Public

	Return :		void
	Parameters :	CSize size	-	The size to set
					
	Usage :			Call to set the paper size. Note that 
					"SetModified( TRUE )" might have to be called 
					as well.

   ============================================================*/
{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青草成人在线观看| 国产校园另类小说区| 亚洲精品乱码久久久久久久久| www.成人网.com| 亚洲三级电影全部在线观看高清| 欧美亚洲一区三区| 久久超碰97中文字幕| 中文字幕国产一区| 欧洲生活片亚洲生活在线观看| 婷婷综合五月天| 日韩一区日韩二区| 欧美日韩中文精品| 久久99最新地址| 中文字幕不卡在线| 欧美日韩成人一区二区| 极品少妇xxxx精品少妇| 亚洲色图制服丝袜| 日韩一级高清毛片| 不卡av免费在线观看| 日韩精品午夜视频| 国产精品久久久久久久久久久免费看 | 亚洲人快播电影网| 制服丝袜中文字幕亚洲| 国产一区二区三区精品视频| 一区二区三区电影在线播| 欧美成人在线直播| 色网站国产精品| 精品一区二区三区免费视频| 亚洲男人的天堂av| 欧美sm美女调教| 日韩亚洲欧美一区| 国产成人精品一区二| 一区二区在线看| 26uuuu精品一区二区| 日本韩国欧美一区| 国产精品一区二区在线播放 | 欧美婷婷六月丁香综合色| 捆绑紧缚一区二区三区视频| 一区二区三区在线观看欧美| 久久免费的精品国产v∧| 欧美日韩小视频| 91丨porny丨国产| 另类小说色综合网站| 亚洲三级免费观看| 国产欧美日韩不卡免费| 制服丝袜日韩国产| 欧美在线观看你懂的| 成人高清视频在线观看| 韩国精品一区二区| 日本亚洲电影天堂| 亚洲国产三级在线| 亚洲免费观看高清| 日本道精品一区二区三区| 色网站国产精品| 国产成人一区二区精品非洲| 日韩精品一卡二卡三卡四卡无卡| 国产精品美女久久久久久| 久久嫩草精品久久久久| 欧美一级一区二区| 91精品国产综合久久精品性色| 91黄视频在线观看| 成人国产精品免费| 成人黄色大片在线观看| 国产精一品亚洲二区在线视频| 麻豆91精品视频| 天堂va蜜桃一区二区三区漫画版| 亚洲综合丝袜美腿| 亚洲午夜久久久久久久久久久| 亚洲免费在线观看| 亚洲欧美日韩国产综合| 亚洲天堂网中文字| 亚洲精品国产成人久久av盗摄| 成人欧美一区二区三区黑人麻豆| 国产精品久久久久久久久搜平片| 国产人成一区二区三区影院| 欧美国产国产综合| 国产精品国产自产拍在线| 国产一区二区在线免费观看| 亚洲成人先锋电影| 香蕉成人伊视频在线观看| 亚洲美女屁股眼交| 一区二区三区视频在线看| 樱花草国产18久久久久| 一区二区久久久久久| 亚洲大型综合色站| 麻豆精品久久精品色综合| 久久99久久精品| 国内久久精品视频| 国产精品99久久久久| 成人不卡免费av| 91国偷自产一区二区三区观看| 在线视频国内一区二区| 欧美日韩国产三级| 精品国产污污免费网站入口 | 亚洲男人的天堂在线aⅴ视频 | 国产精品久久久久影院老司| 久久9热精品视频| 精彩视频一区二区三区| 色一情一乱一乱一91av| 欧美三级韩国三级日本三斤| 91精品免费观看| 久久午夜电影网| 自拍偷自拍亚洲精品播放| 亚洲成人综合网站| 久久电影国产免费久久电影 | 日本成人在线电影网| 国产在线不卡视频| 日本久久电影网| 日韩欧美资源站| 国产精品国产成人国产三级| 午夜伊人狠狠久久| 粉嫩欧美一区二区三区高清影视| 在线观看不卡视频| 久久久久久久久97黄色工厂| 亚洲综合区在线| 国产激情一区二区三区| 欧美日韩成人一区二区| 欧美韩日一区二区三区| 婷婷久久综合九色综合绿巨人 | 欧美日韩二区三区| 在线播放中文一区| 欧美激情在线看| 日日摸夜夜添夜夜添国产精品 | 日韩一二三区视频| 国产精品精品国产色婷婷| 天天做天天摸天天爽国产一区| 国产成人综合在线| 欧美巨大另类极品videosbest | 美腿丝袜在线亚洲一区| 99国产精品久久久| 精品久久久久久久人人人人传媒| 亚洲最新在线观看| 成人免费视频app| 精品久久免费看| 天天免费综合色| 99精品久久久久久| 久久综合色鬼综合色| 天天爽夜夜爽夜夜爽精品视频| 99re6这里只有精品视频在线观看| 欧美本精品男人aⅴ天堂| 国产成人精品亚洲777人妖| 一本色道久久综合亚洲91| 久久精品亚洲乱码伦伦中文| 日韩av网站在线观看| 91豆麻精品91久久久久久| 丝瓜av网站精品一区二区| gogo大胆日本视频一区| 欧美精品一区二区三区在线播放| 亚洲777理论| 在线观看www91| 一区二区三区色| av不卡免费电影| 国产精品久久久久影视| 国产+成+人+亚洲欧洲自线| 精品日韩欧美一区二区| 日本成人在线一区| 在线成人午夜影院| 日本三级亚洲精品| 欧美精品在线观看播放| 视频一区在线播放| 在线综合亚洲欧美在线视频| 午夜精品福利久久久| 欧美日韩国产色站一区二区三区| 一区二区三区四区蜜桃| 色婷婷综合激情| 亚洲另类中文字| 欧美色中文字幕| 午夜精品福利视频网站| 欧美一区二区三区影视| 免费欧美在线视频| 2023国产精品视频| 国产91丝袜在线18| **性色生活片久久毛片| 欧美性做爰猛烈叫床潮| 亚洲国产精品一区二区www | 一本到一区二区三区| 亚洲欧美日韩国产手机在线| 欧美中文字幕不卡| 青青国产91久久久久久| 欧美成人女星排行榜| 国产精品888| 成人免费高清在线观看| 在线播放日韩导航| 蜜臀av一区二区| 日本一区二区动态图| av成人动漫在线观看| 亚洲第四色夜色| 精品国产一区久久| av在线播放一区二区三区| 亚洲曰韩产成在线| 日韩小视频在线观看专区| 国产成人午夜高潮毛片| 一区二区三区中文字幕精品精品 | 91精品国产入口| 亚洲免费在线看| 精品视频一区二区三区免费| 免费人成网站在线观看欧美高清| 久久蜜桃香蕉精品一区二区三区| 欧美色男人天堂| 国内成人免费视频|