|
|
|
@ -3,17 +3,21 @@
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { ExtendedKeyMapOptions } from 'react-hotkeys';
|
|
|
|
import Icon from 'antd/lib/icon';
|
|
|
|
import Icon from 'antd/lib/icon';
|
|
|
|
import Text from 'antd/lib/typography/Text';
|
|
|
|
import Text from 'antd/lib/typography/Text';
|
|
|
|
import Tooltip from 'antd/lib/tooltip';
|
|
|
|
import Tooltip from 'antd/lib/tooltip';
|
|
|
|
import Button from 'antd/lib/button';
|
|
|
|
import Button from 'antd/lib/button';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { formatShortcuts } from 'utils/shortcuts';
|
|
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
interface Props {
|
|
|
|
currentLabel: string;
|
|
|
|
currentLabel: string;
|
|
|
|
clientID: number;
|
|
|
|
clientID: number;
|
|
|
|
occluded: boolean;
|
|
|
|
occluded: boolean;
|
|
|
|
objectsCount: number;
|
|
|
|
objectsCount: number;
|
|
|
|
currentIndex: number;
|
|
|
|
currentIndex: number;
|
|
|
|
|
|
|
|
keyMap: Record<string, ExtendedKeyMapOptions>;
|
|
|
|
nextObject(step: number): void;
|
|
|
|
nextObject(step: number): void;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -24,23 +28,28 @@ function ObjectSwitcher(props: Props): JSX.Element {
|
|
|
|
objectsCount,
|
|
|
|
objectsCount,
|
|
|
|
currentIndex,
|
|
|
|
currentIndex,
|
|
|
|
nextObject,
|
|
|
|
nextObject,
|
|
|
|
|
|
|
|
keyMap,
|
|
|
|
} = props;
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const title = `${currentLabel} ${clientID} [${currentIndex + 1}/${objectsCount}]`;
|
|
|
|
const title = `${currentLabel} ${clientID} [${currentIndex + 1}/${objectsCount}]`;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className='attribute-annotation-sidebar-switcher'>
|
|
|
|
<div className='attribute-annotation-sidebar-switcher'>
|
|
|
|
<Button disabled={objectsCount <= 1} onClick={() => nextObject(-1)}>
|
|
|
|
<Tooltip title={`Previous object ${formatShortcuts(keyMap.PREVIOUS_OBJECT)}`}>
|
|
|
|
<Icon type='left' />
|
|
|
|
<Button disabled={objectsCount <= 1} onClick={() => nextObject(-1)}>
|
|
|
|
</Button>
|
|
|
|
<Icon type='left' />
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip title={title}>
|
|
|
|
<Tooltip title={title}>
|
|
|
|
<Text className='cvat-text'>{currentLabel}</Text>
|
|
|
|
<Text className='cvat-text'>{currentLabel}</Text>
|
|
|
|
<Text className='cvat-text'>{` ${clientID} `}</Text>
|
|
|
|
<Text className='cvat-text'>{` ${clientID} `}</Text>
|
|
|
|
<Text strong>{`[${currentIndex + 1}/${objectsCount}]`}</Text>
|
|
|
|
<Text strong>{`[${currentIndex + 1}/${objectsCount}]`}</Text>
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
<Button disabled={objectsCount <= 1} onClick={() => nextObject(1)}>
|
|
|
|
<Tooltip title={`Next object ${formatShortcuts(keyMap.NEXT_OBJECT)}`}>
|
|
|
|
<Icon type='right' />
|
|
|
|
<Button disabled={objectsCount <= 1} onClick={() => nextObject(1)}>
|
|
|
|
</Button>
|
|
|
|
<Icon type='right' />
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|